root / trunk / web / dojo / dojox / rpc / SMDLibrary / google.smd @ 10
History | View | Annotate | Download (4.2 KB)
1 |
{ |
---|---|
2 |
// Google Ajax API SMD as defined by: |
3 |
// http://code.google.com/apis/ajaxsearch/documentation/reference.html |
4 |
// PLEASE Read the Google Terms of Service: |
5 |
// http://code.google.com/apis/ajaxsearch/terms.html |
6 |
|
7 |
"SMDVersion": "2.0", |
8 |
"id": "http://ajax.googleapis.com/ajax/services/search/", |
9 |
"description": "Google Ajax API", |
10 |
|
11 |
"transport": "JSONP", |
12 |
"envelope": "URL", |
13 |
"additionalParameters": true, |
14 |
|
15 |
"parameters": [ |
16 |
// the most important param, the search query: |
17 |
{ "name": "q", optional: false, "default":"" }, |
18 |
|
19 |
// Google doesn't require, but appreciates, you using an API key |
20 |
// see: http://code.google.com/apis/ajaxsearch/signup.html |
21 |
// { "name": "key", optional: true, "default": "[enter your key]" }, |
22 |
|
23 |
// result size: large | small (8 or 4 per page) |
24 |
{ "name": "rsz", optional:true, "default": "small" }, |
25 |
|
26 |
// language selection: |
27 |
{ "name": "hl", optional:true, "default": "en" }, |
28 |
|
29 |
// starting offset |
30 |
{ "name": "start", optional:true, "default": 0 }, |
31 |
|
32 |
{ "name": "alt", optional:false, "default": "json" }, |
33 |
|
34 |
// API version: only 1.0 supported |
35 |
{ "name": "v", optional:false, "default": "1.0" } |
36 |
], |
37 |
|
38 |
"services": { |
39 |
|
40 |
"webSearch": { |
41 |
"target": "http://ajax.googleapis.com/ajax/services/search/web", |
42 |
"parameters": [ |
43 |
{ "name": "cx", "type":"string", "optional":true }, // unique id |
44 |
{ "name": "cref", "type":"string", "optional":true }, // linked custom search engine |
45 |
{ "name": "safe", "type":"string", "optional":true }, // active | moderate | off |
46 |
// lr: see: http://www.google.com/coop/docs/cse/resultsxml.html#languageCollections |
47 |
{ "name": "lr", "type":"string", "optional":true } // restrict to lang |
48 |
] |
49 |
}, |
50 |
|
51 |
"localSearch": { |
52 |
"target": "http://ajax.googleapis.com/ajax/services/search/local", |
53 |
"parameters": [ |
54 |
// comma separated lat,long value to use for center |
55 |
{ "name": "sll", "type": "string", "optional": true }, |
56 |
{ "name": "sspn", "type":"string", "optional": true } // bounding box? |
57 |
] |
58 |
}, |
59 |
|
60 |
"videoSearch": { |
61 |
"target": "http://ajax.googleapis.com/ajax/services/search/video", |
62 |
"parameters": [ |
63 |
// ordering, set "d" to order by date, "default": by relevance |
64 |
{ "name": "scoring", "type": "string", "optional": true } |
65 |
] |
66 |
}, |
67 |
|
68 |
"blogSearch": { |
69 |
"target": "http://ajax.googleapis.com/ajax/services/search/blogs", |
70 |
"parameters": [ |
71 |
// see videoSearch params |
72 |
{ "name": "scoring", "type": "string", "optional": true } |
73 |
] |
74 |
}, |
75 |
|
76 |
"newsSearch": { |
77 |
"target": "http://ajax.googleapis.com/ajax/services/search/news", |
78 |
"parameters": [ |
79 |
{ "name": "scoring", "type": "string", "optional": true }, |
80 |
// geo: scope search to location. supply city, state, country, or zipcode |
81 |
// using geo makes "q" param optional |
82 |
{ "name": "geo", "type":"string", optional:true } |
83 |
] |
84 |
}, |
85 |
|
86 |
"bookSearch": { |
87 |
"target": "http://ajax.googleapis.com/ajax/services/search/books", |
88 |
"parameters": [ |
89 |
// set to "1" to only include full books |
90 |
{ "name":"as_brr", "optional": true, "type":"number" }, |
91 |
// restrict search to user-defined library |
92 |
{ "name":"as_list", "optional": true, "type":"string" } |
93 |
] |
94 |
}, |
95 |
|
96 |
"imageSearch": { |
97 |
"target": "http://ajax.googleapis.com/ajax/services/search/images", |
98 |
"parameters": [ |
99 |
// safe: active | moderate | off |
100 |
{ "name": "safe", "type":"string", "optional":true }, |
101 |
// limit image size: one of: icon, small|medium|large|xlarge, xxlarge, huge |
102 |
{ "name": "imgsz", "type":"string", "optional": true }, |
103 |
// limit image color: one of: mono|gray|color |
104 |
{ "name": "imgc", "type":"string", "optional": true }, |
105 |
// use "face" to limit to mugshots |
106 |
{ "name": "imgtype", "type":"string", "optional": true }, |
107 |
// limit to file "type": jpg|png|gif|bmp |
108 |
{ "name": "as_filetype", "type": "string", "optional": true }, |
109 |
// limit results to domain: |
110 |
{ "name": "as_sitesearch", "type": "string", "optional": true } |
111 |
] |
112 |
}, |
113 |
|
114 |
"getFeed": { |
115 |
"target": "http://ajax.googleapis.com/ajax/services/feed/load", |
116 |
// pass a feed URL in the q parameter |
117 |
"parameters": [] |
118 |
}, |
119 |
|
120 |
"translate" : { |
121 |
"target" : "http://ajax.googleapis.com/ajax/services/language/translate", |
122 |
"parameters": [ |
123 |
// A String like "en|es" (for english -> spanish) |
124 |
{ "name":"langpair", "type":"string", optional:false } |
125 |
] |
126 |
} |
127 |
|
128 |
} |
129 |
} |