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 | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 20 | dateRestrict: string, Specifies all search results are from a time period<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 21 | hl: string, Sets the user interface language.<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 22 | orTerms: string, Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms<br> |
| 23 | highRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query<br> |
| 24 | num: integer, Number of search results to return<br> |
| 25 | cr: string, Country restrict(s).<br> |
| 26 | imgType: string, Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.<br> |
| 27 | Allowed values<br> |
| 28 | clipart - clipart<br> |
| 29 | face - face<br> |
| 30 | lineart - lineart<br> |
| 31 | news - news<br> |
| 32 | photo - photo<br> |
| 33 | relatedSite: string, Specifies that all search results should be pages that are related to the specified URL<br> |
Joe Gregorio | 0250385 | 2011-08-31 09:07:55 -0400 | [diff] [blame] | 34 | filter: string, Controls turning on or off the duplicate content filter.<br> |
| 35 | Allowed values<br> |
| 36 | 0 - Turns off duplicate content filter.<br> |
| 37 | 1 - Turns on duplicate content filter.<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 38 | pp: string, A parameter<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 39 | gl: string, Geolocation of end user.<br> |
| 40 | searchType: string, Specifies the search type: image.<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 41 | Allowed values<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 42 | image - custom image search<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 43 | strict: string, A parameter<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 44 | fileType: string, Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...<br> |
| 45 | start: integer, The index of the first result to return<br> |
| 46 | imgDominantColor: string, Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.<br> |
| 47 | Allowed values<br> |
| 48 | black - black<br> |
| 49 | blue - blue<br> |
| 50 | brown - brown<br> |
| 51 | gray - gray<br> |
| 52 | green - green<br> |
| 53 | pink - pink<br> |
| 54 | purple - purple<br> |
| 55 | teal - teal<br> |
| 56 | white - white<br> |
| 57 | yellow - yellow<br> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 58 | lr: string, The language restriction for the search results<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 59 | Allowed values<br> |
| 60 | lang_ar - Arabic<br> |
| 61 | lang_bg - Bulgarian<br> |
| 62 | lang_ca - Catalan<br> |
| 63 | lang_cs - Czech<br> |
| 64 | lang_da - Danish<br> |
| 65 | lang_de - German<br> |
| 66 | lang_el - Greek<br> |
| 67 | lang_en - English<br> |
| 68 | lang_es - Spanish<br> |
| 69 | lang_et - Estonian<br> |
| 70 | lang_fi - Finnish<br> |
| 71 | lang_fr - French<br> |
| 72 | lang_hr - Croatian<br> |
| 73 | lang_hu - Hungarian<br> |
| 74 | lang_id - Indonesian<br> |
| 75 | lang_is - Icelandic<br> |
| 76 | lang_it - Italian<br> |
| 77 | lang_iw - Hebrew<br> |
| 78 | lang_ja - Japanese<br> |
| 79 | lang_ko - Korean<br> |
| 80 | lang_lt - Lithuanian<br> |
| 81 | lang_lv - Latvian<br> |
| 82 | lang_nl - Dutch<br> |
| 83 | lang_no - Norwegian<br> |
| 84 | lang_pl - Polish<br> |
| 85 | lang_pt - Portuguese<br> |
| 86 | lang_ro - Romanian<br> |
| 87 | lang_ru - Russian<br> |
| 88 | lang_sk - Slovak<br> |
| 89 | lang_sl - Slovenian<br> |
| 90 | lang_sr - Serbian<br> |
| 91 | lang_sv - Swedish<br> |
| 92 | lang_tr - Turkish<br> |
| 93 | lang_zh-CN - Chinese (Simplified)<br> |
| 94 | lang_zh-TW - Chinese (Traditional)<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 95 | siteSearch: string, Specifies all search results should be pages from a given site<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 96 | cref: string, The URL of a linked custom search engine<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 97 | sort: string, The sort expression to apply to the results<br> |
| 98 | hq: string, Appends the extra query terms to the query.<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 99 | trace: string, A parameter<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 100 | c2coff: string, Turns off the translation between zh-CN and zh-TW.<br> |
| 101 | googlehost: string, The local Google domain to use to perform the search.<br> |
| 102 | safe: string, Search safety level<br> |
| 103 | Allowed values<br> |
| 104 | high - Enables highest level of safe search filtering.<br> |
| 105 | medium - Enables moderate safe search filtering.<br> |
| 106 | off - Disables safe search filtering.<br> |
| 107 | exactTerms: string, Identifies a phrase that all documents in the search results must contain<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 108 | lowRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query<br> |
| 109 | imgSize: string, Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.<br> |
| 110 | Allowed values<br> |
| 111 | huge - huge<br> |
| 112 | icon - icon<br> |
| 113 | large - large<br> |
| 114 | medium - medium<br> |
| 115 | small - small<br> |
| 116 | xlarge - xlarge<br> |
| 117 | xxlarge - xxlarge<br> |
| 118 | imgColorType: string, Returns black and white, grayscale, or color images: mono, gray, and color.<br> |
| 119 | Allowed values<br> |
| 120 | color - color<br> |
| 121 | gray - gray<br> |
| 122 | mono - mono<br> |
| 123 | rights: string, Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.<br> |
| 124 | excludeTerms: string, Identifies a word or phrase that should not appear in any documents in the search results<br> |
| 125 | q: string, Query (required)<br> |
| 126 | linkSite: string, Specifies that all search results should contain a link to a particular URL<br> |
| 127 | cx: string, The custom search engine ID to scope this search query<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 128 | userip: string, A parameter<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 129 | siteSearchFilter: string, Controls whether to include or exclude results from the site named in the as_sitesearch parameter<br> |
| 130 | Allowed values<br> |
| 131 | e - exclude<br> |
| 132 | i - include<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 133 | <br> |
| 134 | Returns:<br> |
| 135 | An object of the form<br> |
| 136 | <br> |
| 137 | {<br> |
| 138 | "promotions": [<br> |
| 139 | {<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 140 | "title": "A String",<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 141 | "displayLink": "A String",<br> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 142 | "htmlTitle": "A String",<br> |
| 143 | "link": "A String",<br> |
| 144 | "bodyLines": [<br> |
| 145 | {<br> |
| 146 | "url": "A String",<br> |
| 147 | "htmlTitle": "A String",<br> |
| 148 | "link": "A String",<br> |
| 149 | "title": "A String",<br> |
| 150 | },<br> |
| 151 | ],<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 152 | "image": {<br> |
| 153 | "source": "A String",<br> |
| 154 | "width": 42,<br> |
| 155 | "height": 42,<br> |
| 156 | },<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 157 | },<br> |
| 158 | ],<br> |
| 159 | "kind": "customsearch#search",<br> |
| 160 | "url": {<br> |
| 161 | "type": "application/json",<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 162 | "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json",<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 163 | },<br> |
| 164 | "items": [<br> |
| 165 | {<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 166 | "snippet": "A String",<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 167 | "kind": "customsearch#result",<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 168 | "labels": [<br> |
| 169 | {<br> |
| 170 | "displayName": "A String",<br> |
| 171 | "name": "A String",<br> |
| 172 | },<br> |
| 173 | ],<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 174 | "title": "A String",<br> |
| 175 | "displayLink": "A String",<br> |
| 176 | "cacheId": "A String",<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 177 | "formattedUrl": "A String",<br> |
| 178 | "htmlFormattedUrl": "A String",<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 179 | "pagemap": {<br> |
| 180 | },<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 181 | "htmlTitle": "A String",<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 182 | "htmlSnippet": "A String",<br> |
| 183 | "link": "A String",<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 184 | "image": {<br> |
| 185 | "thumbnailWidth": 42,<br> |
| 186 | "byteSize": 42,<br> |
| 187 | "height": 42,<br> |
| 188 | "width": 42,<br> |
| 189 | "contextLink": "A String",<br> |
| 190 | "thumbnailLink": "A String",<br> |
| 191 | "thumbnailHeight": 42,<br> |
| 192 | },<br> |
| 193 | "mime": "A String",<br> |
| 194 | "fileFormat": "A String",<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 195 | },<br> |
| 196 | ],<br> |
| 197 | "context": {<br> |
| 198 | "facets": [<br> |
| 199 | [<br> |
| 200 | {<br> |
| 201 | "anchor": "A String",<br> |
| 202 | "label": "A String",<br> |
| 203 | },<br> |
| 204 | ],<br> |
| 205 | ],<br> |
| 206 | "title": "A String",<br> |
| 207 | },<br> |
| 208 | "queries": {<br> |
| 209 | },<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 210 | "spelling": {<br> |
| 211 | "correctedQuery": "A String",<br> |
| 212 | "htmlCorrectedQuery": "A String",<br> |
| 213 | },<br> |
| 214 | "searchInformation": {<br> |
| 215 | "formattedSearchTime": "A String",<br> |
| 216 | "formattedTotalResults": "A String",<br> |
| 217 | "totalResults": "A String",<br> |
| 218 | "searchTime": 3.14,<br> |
| 219 | },<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 220 | }</tt></dd></dl> |
Joe Gregorio | afc45f2 | 2011-02-20 16:11:28 -0500 | [diff] [blame] | 221 | |
| 222 | <hr> |
| 223 | Data descriptors defined here:<br> |
| 224 | <dl><dt><strong>__dict__</strong></dt> |
| 225 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 226 | </dl> |
| 227 | <dl><dt><strong>__weakref__</strong></dt> |
| 228 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 229 | </dl> |
| 230 | </td></tr></table> |
| 231 | </body></html> |