Joe Gregorio | afc45f2 | 2011-02-20 16:11:28 -0500 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: class Resource</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | <p> |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 7 | <tr bgcolor="#ffc8d8"> |
| 8 | <td colspan=3 valign=bottom> <br> |
| 9 | <font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 10 | |
| 11 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 12 | <td colspan=2><tt>A class for interacting with a resource.<br> </tt></td></tr> |
| 13 | <tr><td> </td> |
| 14 | <td width="100%">Methods defined here:<br> |
| 15 | <dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| 16 | |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 17 | <dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.<br> |
Joe Gregorio | afc45f2 | 2011-02-20 16:11:28 -0500 | [diff] [blame] | 18 | <br> |
| 19 | Args:<br> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 20 | sort: string, The sort expression to apply to the results<br> |
Joe Gregorio | 0250385 | 2011-08-31 09:07:55 -0400 | [diff] [blame] | 21 | filter: string, Controls turning on or off the duplicate content filter.<br> |
| 22 | Allowed values<br> |
| 23 | 0 - Turns off duplicate content filter.<br> |
| 24 | 1 - Turns on duplicate content filter.<br> |
Joe Gregorio | 20a5aa9 | 2011-04-01 17:44:25 -0400 | [diff] [blame] | 25 | start: string, The index of the first result to return<br> |
Joe Gregorio | 0250385 | 2011-08-31 09:07:55 -0400 | [diff] [blame] | 26 | cx: string, The custom search engine ID to scope this search query<br> |
| 27 | googlehost: string, The local Google domain to use to perform the search.<br> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 28 | safe: string, Search safety level<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 29 | Allowed values<br> |
| 30 | high - Enables highest level of safe search filtering.<br> |
| 31 | medium - Enables moderate safe search filtering.<br> |
| 32 | off - Disables safe search filtering.<br> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 33 | q: string, Query (required)<br> |
Joe Gregorio | 0250385 | 2011-08-31 09:07:55 -0400 | [diff] [blame] | 34 | num: string, Number of search results to return<br> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 35 | lr: string, The language restriction for the search results<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 36 | Allowed values<br> |
| 37 | lang_ar - Arabic<br> |
| 38 | lang_bg - Bulgarian<br> |
| 39 | lang_ca - Catalan<br> |
| 40 | lang_cs - Czech<br> |
| 41 | lang_da - Danish<br> |
| 42 | lang_de - German<br> |
| 43 | lang_el - Greek<br> |
| 44 | lang_en - English<br> |
| 45 | lang_es - Spanish<br> |
| 46 | lang_et - Estonian<br> |
| 47 | lang_fi - Finnish<br> |
| 48 | lang_fr - French<br> |
| 49 | lang_hr - Croatian<br> |
| 50 | lang_hu - Hungarian<br> |
| 51 | lang_id - Indonesian<br> |
| 52 | lang_is - Icelandic<br> |
| 53 | lang_it - Italian<br> |
| 54 | lang_iw - Hebrew<br> |
| 55 | lang_ja - Japanese<br> |
| 56 | lang_ko - Korean<br> |
| 57 | lang_lt - Lithuanian<br> |
| 58 | lang_lv - Latvian<br> |
| 59 | lang_nl - Dutch<br> |
| 60 | lang_no - Norwegian<br> |
| 61 | lang_pl - Polish<br> |
| 62 | lang_pt - Portuguese<br> |
| 63 | lang_ro - Romanian<br> |
| 64 | lang_ru - Russian<br> |
| 65 | lang_sk - Slovak<br> |
| 66 | lang_sl - Slovenian<br> |
| 67 | lang_sr - Serbian<br> |
| 68 | lang_sv - Swedish<br> |
| 69 | lang_tr - Turkish<br> |
| 70 | lang_zh-CN - Chinese (Simplified)<br> |
| 71 | lang_zh-TW - Chinese (Traditional)<br> |
Joe Gregorio | 0250385 | 2011-08-31 09:07:55 -0400 | [diff] [blame] | 72 | cr: string, Country restrict(s).<br> |
| 73 | gl: string, Geolocation of end user.<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 74 | cref: string, The URL of a linked custom search engine<br> |
| 75 | <br> |
| 76 | Returns:<br> |
| 77 | An object of the form<br> |
| 78 | <br> |
| 79 | {<br> |
| 80 | "promotions": [<br> |
| 81 | {<br> |
| 82 | "link": "A String",<br> |
| 83 | "displayLink": "A String",<br> |
| 84 | "image": {<br> |
| 85 | "source": "A String",<br> |
| 86 | "width": 42,<br> |
| 87 | "height": 42,<br> |
| 88 | },<br> |
| 89 | "bodyLines": [<br> |
| 90 | {<br> |
| 91 | "url": "A String",<br> |
| 92 | "link": "A String",<br> |
| 93 | "title": "A String",<br> |
| 94 | },<br> |
| 95 | ],<br> |
| 96 | "title": "A String",<br> |
| 97 | },<br> |
| 98 | ],<br> |
| 99 | "kind": "customsearch#search",<br> |
| 100 | "url": {<br> |
| 101 | "type": "application/json",<br> |
| 102 | "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&hr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&alt=json",<br> |
| 103 | },<br> |
| 104 | "items": [<br> |
| 105 | {<br> |
| 106 | "kind": "customsearch#result",<br> |
| 107 | "title": "A String",<br> |
| 108 | "displayLink": "A String",<br> |
| 109 | "cacheId": "A String",<br> |
| 110 | "pagemap": {<br> |
| 111 | },<br> |
| 112 | "snippet": "A String",<br> |
| 113 | "htmlSnippet": "A String",<br> |
| 114 | "link": "A String",<br> |
| 115 | "htmlTitle": "A String",<br> |
| 116 | },<br> |
| 117 | ],<br> |
| 118 | "context": {<br> |
| 119 | "facets": [<br> |
| 120 | [<br> |
| 121 | {<br> |
| 122 | "anchor": "A String",<br> |
| 123 | "label": "A String",<br> |
| 124 | },<br> |
| 125 | ],<br> |
| 126 | ],<br> |
| 127 | "title": "A String",<br> |
| 128 | },<br> |
| 129 | "queries": {<br> |
| 130 | },<br> |
| 131 | }</tt></dd></dl> |
Joe Gregorio | afc45f2 | 2011-02-20 16:11:28 -0500 | [diff] [blame] | 132 | |
| 133 | <hr> |
| 134 | Data descriptors defined here:<br> |
| 135 | <dl><dt><strong>__dict__</strong></dt> |
| 136 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 137 | </dl> |
| 138 | <dl><dt><strong>__weakref__</strong></dt> |
| 139 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 140 | </dl> |
| 141 | </td></tr></table> |
| 142 | </body></html> |