google_custom_search_api 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +16 -0
- data/init.rb +2 -0
- data/lib/google_custom_search_api.rb +18 -2
- data/lib/version.rb +1 -1
- metadata +7 -12
- data/.gitignore +0 -4
- data/spec/fixtures/empty.json +0 -31
- data/spec/fixtures/poker.json +0 -290
- data/spec/fixtures/poker_81.json +0 -302
- data/spec/fixtures/poker_91.json +0 -238
- data/spec/google_custom_search_api_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -14
data/Gemfile
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
google_custom_search_api (0.0.
|
4
|
+
google_custom_search_api (0.0.4)
|
5
5
|
httparty
|
6
6
|
|
7
7
|
GEM
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
multi_json
|
15
15
|
multi_xml
|
16
16
|
json (1.6.5)
|
17
|
-
multi_json (1.
|
17
|
+
multi_json (1.3.4)
|
18
18
|
multi_xml (0.4.2)
|
19
19
|
rspec (2.9.0)
|
20
20
|
rspec-core (~> 2.9.0)
|
data/README.md
CHANGED
@@ -58,6 +58,22 @@ or
|
|
58
58
|
end
|
59
59
|
```
|
60
60
|
|
61
|
+
You can get all ten pages at once by doing:
|
62
|
+
|
63
|
+
```
|
64
|
+
results = GoogleCustomSearchApi.search_and_return_all_results(query, opts)
|
65
|
+
results.size == 10
|
66
|
+
results.collect {|r| r.items.size }.sum == 100 #if there were 100 results
|
67
|
+
```
|
68
|
+
|
69
|
+
search_and_return_all_results also yields results as it goes:
|
70
|
+
|
71
|
+
```
|
72
|
+
GoogleCustomSearchApi.search_and_return_all_results(query, opts) do |results|
|
73
|
+
results.items.size == 10
|
74
|
+
end
|
75
|
+
```
|
76
|
+
|
61
77
|
See [Custom Search](http://code.google.com/apis/customsearch/v1/using_rest.html) documentation for an explanation of all fields available.
|
62
78
|
|
63
79
|
### Paging
|
data/init.rb
ADDED
@@ -13,9 +13,19 @@ module GoogleCustomSearchApi
|
|
13
13
|
def search(query, opts = {})
|
14
14
|
# Get and parse results.
|
15
15
|
url = url(query, opts)
|
16
|
-
puts url
|
16
|
+
# puts url
|
17
17
|
return nil unless results = fetch(url)
|
18
18
|
results["items"] ||= []
|
19
|
+
|
20
|
+
if file_path = opts[:save_json_to_file_path]
|
21
|
+
opts[:start] ||= 1
|
22
|
+
Dir.mkdir(file_path) unless Dir.exists?(file_path)
|
23
|
+
fname = "google_#{query.gsub(/[^0-9A-Za-z]/, '_')}_#{opts[:start]}.json"
|
24
|
+
file = File.join(file_path, fname)
|
25
|
+
File.delete(file) if File.exist?(file)
|
26
|
+
open(file,'w') do |f|; f.puts results.to_json; end
|
27
|
+
end
|
28
|
+
|
19
29
|
ResponseData.new(results)
|
20
30
|
end
|
21
31
|
|
@@ -23,7 +33,9 @@ module GoogleCustomSearchApi
|
|
23
33
|
res = []
|
24
34
|
opts[:start] ||= 1
|
25
35
|
begin
|
26
|
-
results = GoogleCustomSearchApi.search(
|
36
|
+
results = GoogleCustomSearchApi.search(query,opts)
|
37
|
+
# results = ResponseData.new(read_search_data("google_poker_#{opts[:start]}"))
|
38
|
+
yield results
|
27
39
|
res << results
|
28
40
|
if results.queries.keys.include?("nextPage")
|
29
41
|
opts[:start] = results.queries.nextPage.first.startIndex
|
@@ -34,6 +46,10 @@ module GoogleCustomSearchApi
|
|
34
46
|
return res
|
35
47
|
end
|
36
48
|
|
49
|
+
# def read_search_data(fname)
|
50
|
+
# JSON.parse(File.read("/Users/wiseleyb/dev/rubyx/icm/spec/fixtures/searches/#{fname}.json"))
|
51
|
+
# end
|
52
|
+
|
37
53
|
# Convenience wrapper for the response Hash.
|
38
54
|
# Converts keys to Strings. Crawls through all
|
39
55
|
# member data and converts any other Hashes it
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_custom_search_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Wiseley
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-03
|
18
|
+
date: 2012-08-03 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httparty
|
@@ -83,20 +83,15 @@ extensions: []
|
|
83
83
|
extra_rdoc_files: []
|
84
84
|
|
85
85
|
files:
|
86
|
-
- .gitignore
|
87
86
|
- CHANGELOG.rdoc
|
87
|
+
- Gemfile
|
88
88
|
- Gemfile.lock
|
89
|
+
- init.rb
|
89
90
|
- LICENSE
|
90
|
-
- README.md
|
91
91
|
- Rakefile
|
92
|
+
- README.md
|
92
93
|
- lib/google_custom_search_api.rb
|
93
94
|
- lib/version.rb
|
94
|
-
- spec/fixtures/empty.json
|
95
|
-
- spec/fixtures/poker.json
|
96
|
-
- spec/fixtures/poker_81.json
|
97
|
-
- spec/fixtures/poker_91.json
|
98
|
-
- spec/google_custom_search_api_spec.rb
|
99
|
-
- spec/spec_helper.rb
|
100
95
|
homepage: http://github.com/wiseleyb/google_custom_search_api
|
101
96
|
licenses: []
|
102
97
|
|
data/.gitignore
DELETED
data/spec/fixtures/empty.json
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"kind": "customsearch#search",
|
3
|
-
"url": {
|
4
|
-
"type": "application/json",
|
5
|
-
"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"
|
6
|
-
},
|
7
|
-
"queries": {
|
8
|
-
"request": [
|
9
|
-
{
|
10
|
-
"title": "Google Custom Search - asdfojasoidfjao sdfjaosdfj aosdijfoaisdjfoasjdofijas dofijweo fwoef jwoeifjw",
|
11
|
-
"totalResults": "0",
|
12
|
-
"searchTerms": "asdfojasoidfjao sdfjaosdfj aosdijfoaisdjfoasjdofijas dofijweo fwoef jwoeifjw",
|
13
|
-
"count": 10,
|
14
|
-
"inputEncoding": "utf8",
|
15
|
-
"outputEncoding": "utf8",
|
16
|
-
"safe": "off",
|
17
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
18
|
-
}
|
19
|
-
]
|
20
|
-
},
|
21
|
-
"searchInformation": {
|
22
|
-
"searchTime": 0.121274,
|
23
|
-
"formattedSearchTime": "0.12",
|
24
|
-
"totalResults": "0",
|
25
|
-
"formattedTotalResults": "0"
|
26
|
-
},
|
27
|
-
"spelling": {
|
28
|
-
"correctedQuery": "asdf ojasoidfjao sdfj sdfj aosdijfoaisdjfoasjdofijas dofijweo fwoef jwoeifjw",
|
29
|
-
"htmlCorrectedQuery": "\u003cb\u003e\u003ci\u003easdf ojasoidfjao\u003c/i\u003e\u003c/b\u003e \u003cb\u003e\u003ci\u003esdfj sdfj\u003c/i\u003e\u003c/b\u003e aosdijfoaisdjfoasjdofijas dofijweo fwoef jwoeifjw"
|
30
|
-
}
|
31
|
-
}
|
data/spec/fixtures/poker.json
DELETED
@@ -1,290 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"kind": "customsearch#search",
|
3
|
-
"url": {
|
4
|
-
"type": "application/json",
|
5
|
-
"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"
|
6
|
-
},
|
7
|
-
"queries": {
|
8
|
-
"nextPage": [
|
9
|
-
{
|
10
|
-
"title": "Google Custom Search - poker",
|
11
|
-
"totalResults": "40500000",
|
12
|
-
"searchTerms": "poker",
|
13
|
-
"count": 10,
|
14
|
-
"startIndex": 11,
|
15
|
-
"inputEncoding": "utf8",
|
16
|
-
"outputEncoding": "utf8",
|
17
|
-
"safe": "off",
|
18
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
19
|
-
}
|
20
|
-
],
|
21
|
-
"request": [
|
22
|
-
{
|
23
|
-
"title": "Google Custom Search - poker",
|
24
|
-
"totalResults": "40500000",
|
25
|
-
"searchTerms": "poker",
|
26
|
-
"count": 10,
|
27
|
-
"startIndex": 1,
|
28
|
-
"inputEncoding": "utf8",
|
29
|
-
"outputEncoding": "utf8",
|
30
|
-
"safe": "off",
|
31
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
32
|
-
}
|
33
|
-
]
|
34
|
-
},
|
35
|
-
"context": {
|
36
|
-
"title": "ICMS Dev"
|
37
|
-
},
|
38
|
-
"searchInformation": {
|
39
|
-
"searchTime": 0.193868,
|
40
|
-
"formattedSearchTime": "0.19",
|
41
|
-
"totalResults": "40500000",
|
42
|
-
"formattedTotalResults": "40,500,000"
|
43
|
-
},
|
44
|
-
"items": [
|
45
|
-
{
|
46
|
-
"kind": "customsearch#result",
|
47
|
-
"title": "Official World Series of Poker Online",
|
48
|
-
"htmlTitle": "Official World Series of \u003cb\u003ePoker\u003c/b\u003e Online",
|
49
|
-
"link": "http://www.wsop.com/",
|
50
|
-
"displayLink": "www.wsop.com",
|
51
|
-
"snippet": "Official website of the World Series of Poker Tournament. Featuring poker tournament coverage of events, schedules and news. Play online poker games like ...",
|
52
|
-
"htmlSnippet": "Official website of the World Series of \u003cb\u003ePoker\u003c/b\u003e Tournament. Featuring \u003cb\u003epoker\u003c/b\u003e \u003cbr\u003e tournament coverage of events, schedules and news. Play online \u003cb\u003epoker\u003c/b\u003e games \u003cbr\u003e like \u003cb\u003e...\u003c/b\u003e",
|
53
|
-
"cacheId": "T7q1CfbZcPwJ",
|
54
|
-
"formattedUrl": "www.wsop.com/",
|
55
|
-
"htmlFormattedUrl": "www.wsop.com/",
|
56
|
-
"pagemap": {
|
57
|
-
"cse_image": [
|
58
|
-
{
|
59
|
-
"src": "http://www.wsop.com/images/hm/download_image.jpg"
|
60
|
-
}
|
61
|
-
],
|
62
|
-
"cse_thumbnail": [
|
63
|
-
{
|
64
|
-
"width": "185",
|
65
|
-
"height": "113",
|
66
|
-
"src": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcQzUUbsQCEJ9huedBRALkpQPN6QBBwgwIFT2_cEA9hkkJYBehSvRygrQw"
|
67
|
-
}
|
68
|
-
]
|
69
|
-
}
|
70
|
-
},
|
71
|
-
{
|
72
|
-
"kind": "customsearch#result",
|
73
|
-
"title": "Poker - Wikipedia, the free encyclopedia",
|
74
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e - Wikipedia, the free encyclopedia",
|
75
|
-
"link": "http://en.wikipedia.org/wiki/Poker",
|
76
|
-
"displayLink": "en.wikipedia.org",
|
77
|
-
"snippet": "Poker is a family of card games involving betting and individualistic play whereby the winner is determined by the ranks and combinations of their cards, some of ...",
|
78
|
-
"htmlSnippet": "\u003cb\u003ePoker\u003c/b\u003e is a family of card games involving betting and individualistic play whereby \u003cbr\u003e the winner is determined by the ranks and combinations of their cards, some of \u003cb\u003e...\u003c/b\u003e",
|
79
|
-
"cacheId": "M0JijEuvEdkJ",
|
80
|
-
"formattedUrl": "en.wikipedia.org/wiki/Poker",
|
81
|
-
"htmlFormattedUrl": "en.wikipedia.org/wiki/\u003cb\u003ePoker\u003c/b\u003e",
|
82
|
-
"pagemap": {
|
83
|
-
"cse_image": [
|
84
|
-
{
|
85
|
-
"src": "http://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Holdem.jpg/300px-Holdem.jpg"
|
86
|
-
}
|
87
|
-
],
|
88
|
-
"cse_thumbnail": [
|
89
|
-
{
|
90
|
-
"width": "240",
|
91
|
-
"height": "171",
|
92
|
-
"src": "https://encrypted-tbn2.google.com/images?q=tbn:ANd9GcStTlDjK3fS8LXRP2QSifQ1Q5dg0dwpak2LR9aGzPTavzts2b62_Q6t91k"
|
93
|
-
}
|
94
|
-
]
|
95
|
-
}
|
96
|
-
},
|
97
|
-
{
|
98
|
-
"kind": "customsearch#result",
|
99
|
-
"title": "Online Poker - Play Online at Full Tilt Poker Room",
|
100
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e - Play Online at Full Tilt \u003cb\u003ePoker\u003c/b\u003e Room",
|
101
|
-
"link": "http://www.fulltiltpoker.com/",
|
102
|
-
"displayLink": "www.fulltiltpoker.com",
|
103
|
-
"snippet": "Online Poker at the Fastest Growing Online Poker Room. Full Tilt Poker offers the best in online poker: world famous pros, a huge bonus, real or play money.",
|
104
|
-
"htmlSnippet": "Online \u003cb\u003ePoker\u003c/b\u003e at the Fastest Growing Online \u003cb\u003ePoker\u003c/b\u003e Room. Full Tilt \u003cb\u003ePoker\u003c/b\u003e offers the \u003cbr\u003e best in online \u003cb\u003epoker\u003c/b\u003e: world famous pros, a huge bonus, real or play money.",
|
105
|
-
"cacheId": "-0lVMr2LbU0J",
|
106
|
-
"formattedUrl": "www.fulltiltpoker.com/",
|
107
|
-
"htmlFormattedUrl": "www.fulltilt\u003cb\u003epoker\u003c/b\u003e.com/",
|
108
|
-
"pagemap": {
|
109
|
-
"cse_image": [
|
110
|
-
{
|
111
|
-
"src": "http://w.fulltiltcdn.net/images/global/content/home/video-player-still.png"
|
112
|
-
}
|
113
|
-
],
|
114
|
-
"cse_thumbnail": [
|
115
|
-
{
|
116
|
-
"width": "206",
|
117
|
-
"height": "183",
|
118
|
-
"src": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcQNl-iv7LDBN5OsGiWYzyH1ezgTvB2gwEIHhPLqJ0Tkd2OmQiywk0P7fyQ"
|
119
|
-
}
|
120
|
-
],
|
121
|
-
"metatags": [
|
122
|
-
{
|
123
|
-
"uid": "10",
|
124
|
-
"nav_title": "Online Poker"
|
125
|
-
}
|
126
|
-
]
|
127
|
-
}
|
128
|
-
},
|
129
|
-
{
|
130
|
-
"kind": "customsearch#result",
|
131
|
-
"title": "Poker.com - Online Poker Games, Free Tournaments, Rules & News",
|
132
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e.com - Online \u003cb\u003ePoker\u003c/b\u003e Games, Free Tournaments, Rules & News",
|
133
|
-
"link": "http://www.poker.com/",
|
134
|
-
"displayLink": "www.poker.com",
|
135
|
-
"snippet": "The world's #1 free poker information website, with poker game rules, news, tournaments and reviews of all the best online poker rooms.",
|
136
|
-
"htmlSnippet": "The world's #1 free \u003cb\u003epoker\u003c/b\u003e information website, with \u003cb\u003epoker\u003c/b\u003e game rules, news, \u003cbr\u003e tournaments and reviews of all the best online \u003cb\u003epoker\u003c/b\u003e rooms.",
|
137
|
-
"cacheId": "IlkL1Yc3_F8J",
|
138
|
-
"formattedUrl": "www.poker.com/",
|
139
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003e.com/",
|
140
|
-
"pagemap": {
|
141
|
-
"cse_image": [
|
142
|
-
{
|
143
|
-
"src": "http://www.poker.com/pokernews/wp-content/uploads/2011/03/poker.jpg"
|
144
|
-
}
|
145
|
-
],
|
146
|
-
"cse_thumbnail": [
|
147
|
-
{
|
148
|
-
"width": "115",
|
149
|
-
"height": "115",
|
150
|
-
"src": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcRQrcdYcF0OGtXZ2SCv7CP55Z7O_is7guk6l-wEw5s85I-Z-UcBwJ3V9g"
|
151
|
-
}
|
152
|
-
]
|
153
|
-
}
|
154
|
-
},
|
155
|
-
{
|
156
|
-
"kind": "customsearch#result",
|
157
|
-
"title": "Online Poker Sites Toplists & Bonus Offers, Poker Reviews and News",
|
158
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e Sites Toplists & Bonus Offers, \u003cb\u003ePoker\u003c/b\u003e Reviews and News",
|
159
|
-
"link": "http://www.pokerlistings.com/",
|
160
|
-
"displayLink": "www.pokerlistings.com",
|
161
|
-
"snippet": "5 hours ago ... PokerListings is the world's largest online poker guide with the best bonus offers guaranteed and exclusive free tournaments for new players.",
|
162
|
-
"htmlSnippet": "5 hours ago \u003cb\u003e...\u003c/b\u003e PokerListings is the world's largest online \u003cb\u003epoker\u003c/b\u003e guide with the best bonus offers \u003cbr\u003e guaranteed and exclusive free tournaments for new players.",
|
163
|
-
"cacheId": "dq71R1WBRMUJ",
|
164
|
-
"formattedUrl": "www.pokerlistings.com/",
|
165
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003elistings.com/",
|
166
|
-
"pagemap": {
|
167
|
-
"cse_image": [
|
168
|
-
{
|
169
|
-
"src": "http://edge1.pokerlistings.com/assets/Uploads/EN-584x323-AffBanner-2.jpg"
|
170
|
-
}
|
171
|
-
],
|
172
|
-
"cse_thumbnail": [
|
173
|
-
{
|
174
|
-
"width": "302",
|
175
|
-
"height": "167",
|
176
|
-
"src": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcTXMaQ0pVWAUfo2V7ydD3a2sHYiFEPjA4zSEMJAKbC3GQ2Y2PzRAtttp1B3"
|
177
|
-
}
|
178
|
-
]
|
179
|
-
}
|
180
|
-
},
|
181
|
-
{
|
182
|
-
"kind": "customsearch#result",
|
183
|
-
"title": "Governor of Poker - Hot Games at Miniclip.com - Play Free Online ...",
|
184
|
-
"htmlTitle": "Governor of \u003cb\u003ePoker\u003c/b\u003e - Hot Games at Miniclip.com - Play Free Online \u003cb\u003e...\u003c/b\u003e",
|
185
|
-
"link": "http://www.miniclip.com/games/governor-of-poker/en/",
|
186
|
-
"displayLink": "www.miniclip.com",
|
187
|
-
"snippet": "Win all your games in your hometown and become the Governor of Poker!",
|
188
|
-
"htmlSnippet": "Win all your games in your hometown and become the Governor of \u003cb\u003ePoker\u003c/b\u003e!"
|
189
|
-
},
|
190
|
-
{
|
191
|
-
"kind": "customsearch#result",
|
192
|
-
"title": "Online Poker | Play at Pacific poker online and get $8 FREE",
|
193
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e | Play at Pacific \u003cb\u003epoker\u003c/b\u003e online and get $8 FREE",
|
194
|
-
"link": "http://www.pacificpoker.com/",
|
195
|
-
"displayLink": "www.pacificpoker.com",
|
196
|
-
"snippet": "Play online poker at Pacific Poker and get $8 FREE AND $400 bonus to play poker online at 888 poker - the largest and most trusted online poker room.",
|
197
|
-
"htmlSnippet": "Play online \u003cb\u003epoker\u003c/b\u003e at Pacific \u003cb\u003ePoker\u003c/b\u003e and get $8 FREE AND $400 bonus to play \u003cbr\u003e \u003cb\u003epoker\u003c/b\u003e online at 888 \u003cb\u003epoker\u003c/b\u003e - the largest and most trusted online \u003cb\u003epoker\u003c/b\u003e room.",
|
198
|
-
"cacheId": "sYy5C08rRZYJ",
|
199
|
-
"formattedUrl": "www.pacificpoker.com/",
|
200
|
-
"htmlFormattedUrl": "www.pacific\u003cb\u003epoker\u003c/b\u003e.com/",
|
201
|
-
"pagemap": {
|
202
|
-
"cse_image": [
|
203
|
-
{
|
204
|
-
"src": "http://images.888.com/newpoker/lang/en_new/PCP-main_december-400.jpg"
|
205
|
-
}
|
206
|
-
],
|
207
|
-
"cse_thumbnail": [
|
208
|
-
{
|
209
|
-
"width": "339",
|
210
|
-
"height": "148",
|
211
|
-
"src": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcQ0kVbE22EZPQE2iGUuqRFBEzh2odvIS7LfKBDNKBKkxOCoj4TAeMgEZ7c"
|
212
|
-
}
|
213
|
-
]
|
214
|
-
}
|
215
|
-
},
|
216
|
-
{
|
217
|
-
"kind": "customsearch#result",
|
218
|
-
"title": "Online Poker Games | Play for Free Texas Holdem | PokerStars",
|
219
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e Games | Play for Free Texas Holdem | PokerStars",
|
220
|
-
"link": "http://www.pokerstars.net/",
|
221
|
-
"displayLink": "www.pokerstars.net",
|
222
|
-
"snippet": "Play Texas Hold'em poker tournaments and other free poker games at the world's largest online poker room, with PokerStars free software download.",
|
223
|
-
"htmlSnippet": "Play Texas Hold'em \u003cb\u003epoker\u003c/b\u003e tournaments and other free \u003cb\u003epoker\u003c/b\u003e games at the world's \u003cbr\u003e largest online \u003cb\u003epoker\u003c/b\u003e room, with PokerStars free software download.",
|
224
|
-
"cacheId": "QMONnAr9GUMJ",
|
225
|
-
"formattedUrl": "www.pokerstars.net/",
|
226
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003estars.net/",
|
227
|
-
"pagemap": {
|
228
|
-
"cse_image": [
|
229
|
-
{
|
230
|
-
"src": "http://www.pokerstars.net/images/nightly-500-promo-net.jpg"
|
231
|
-
}
|
232
|
-
],
|
233
|
-
"cse_thumbnail": [
|
234
|
-
{
|
235
|
-
"width": "141",
|
236
|
-
"height": "178",
|
237
|
-
"src": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcRiMe-aAj1GQAKfrfatZqzE3BhRT9LjXr6r5v2sVQBfWI3jYqP8m_qMrQVr"
|
238
|
-
}
|
239
|
-
]
|
240
|
-
}
|
241
|
-
},
|
242
|
-
{
|
243
|
-
"kind": "customsearch#result",
|
244
|
-
"title": "Poker News, Online Poker Reviews & Bonuses | PokerNews",
|
245
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e News, Online \u003cb\u003ePoker\u003c/b\u003e Reviews & Bonuses | PokerNews",
|
246
|
-
"link": "http://www.pokernews.com/",
|
247
|
-
"displayLink": "www.pokernews.com",
|
248
|
-
"snippet": "PokerNews is the world's No. 1 poker information source, offering: global poker news coverage, online poker reviews, special poker bonuses and deals, ...",
|
249
|
-
"htmlSnippet": "PokerNews is the world's No. 1 \u003cb\u003epoker\u003c/b\u003e information source, offering: global \u003cb\u003epoker\u003c/b\u003e \u003cbr\u003e news coverage, online \u003cb\u003epoker\u003c/b\u003e reviews, special \u003cb\u003epoker\u003c/b\u003e bonuses and deals, \u003cb\u003e...\u003c/b\u003e",
|
250
|
-
"cacheId": "Rdd35pvFIl8J",
|
251
|
-
"formattedUrl": "www.pokernews.com/",
|
252
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003enews.com/",
|
253
|
-
"pagemap": {
|
254
|
-
"cse_image": [
|
255
|
-
{
|
256
|
-
"src": "http://www.pokernews.com/w/articles/4f5f/91ca6bf60.jpg"
|
257
|
-
}
|
258
|
-
],
|
259
|
-
"cse_thumbnail": [
|
260
|
-
{
|
261
|
-
"width": "276",
|
262
|
-
"height": "183",
|
263
|
-
"src": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcQ0X_cuK9XH4Ys7UmStdrxthiQmmRbklJxCPtYQtQsnkd9pHX7Yyp3Ioro"
|
264
|
-
}
|
265
|
-
],
|
266
|
-
"metatags": [
|
267
|
-
{
|
268
|
-
"fb:admins": "100001502531544",
|
269
|
-
"application-name": "PokerNews Global",
|
270
|
-
"msapplication-starturl": "/",
|
271
|
-
"msapplication-navbutton-color": "#000000",
|
272
|
-
"msapplication-task": "name=News;action-uri=/news/;icon-uri=/img/jumplist/news.ico"
|
273
|
-
}
|
274
|
-
]
|
275
|
-
}
|
276
|
-
},
|
277
|
-
{
|
278
|
-
"kind": "customsearch#result",
|
279
|
-
"title": "WPT | World Poker Tour Home",
|
280
|
-
"htmlTitle": "WPT | World \u003cb\u003ePoker\u003c/b\u003e Tour Home",
|
281
|
-
"link": "http://www.worldpokertour.com/",
|
282
|
-
"displayLink": "www.worldpokertour.com",
|
283
|
-
"snippet": "Official Site. Find show and tournament information. Watch clips, view WPT player bios and statistics, improve your game, and play online.",
|
284
|
-
"htmlSnippet": "Official Site. Find show and tournament information. Watch clips, view WPT \u003cbr\u003e player bios and statistics, improve your game, and play online.",
|
285
|
-
"cacheId": "NjGERrVM5rEJ",
|
286
|
-
"formattedUrl": "www.worldpokertour.com/",
|
287
|
-
"htmlFormattedUrl": "www.world\u003cb\u003epoker\u003c/b\u003etour.com/"
|
288
|
-
}
|
289
|
-
]
|
290
|
-
}
|
data/spec/fixtures/poker_81.json
DELETED
@@ -1,302 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"kind": "customsearch#search",
|
3
|
-
"url": {
|
4
|
-
"type": "application/json",
|
5
|
-
"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"
|
6
|
-
},
|
7
|
-
"queries": {
|
8
|
-
"nextPage": [
|
9
|
-
{
|
10
|
-
"title": "Google Custom Search - poker",
|
11
|
-
"totalResults": "40300000",
|
12
|
-
"searchTerms": "poker",
|
13
|
-
"count": 10,
|
14
|
-
"startIndex": 91,
|
15
|
-
"inputEncoding": "utf8",
|
16
|
-
"outputEncoding": "utf8",
|
17
|
-
"safe": "off",
|
18
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
19
|
-
}
|
20
|
-
],
|
21
|
-
"request": [
|
22
|
-
{
|
23
|
-
"title": "Google Custom Search - poker",
|
24
|
-
"totalResults": "40300000",
|
25
|
-
"searchTerms": "poker",
|
26
|
-
"count": 10,
|
27
|
-
"startIndex": 81,
|
28
|
-
"inputEncoding": "utf8",
|
29
|
-
"outputEncoding": "utf8",
|
30
|
-
"safe": "off",
|
31
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
32
|
-
}
|
33
|
-
],
|
34
|
-
"previousPage": [
|
35
|
-
{
|
36
|
-
"title": "Google Custom Search - poker",
|
37
|
-
"totalResults": "40300000",
|
38
|
-
"searchTerms": "poker",
|
39
|
-
"count": 10,
|
40
|
-
"startIndex": 71,
|
41
|
-
"inputEncoding": "utf8",
|
42
|
-
"outputEncoding": "utf8",
|
43
|
-
"safe": "off",
|
44
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
45
|
-
}
|
46
|
-
]
|
47
|
-
},
|
48
|
-
"context": {
|
49
|
-
"title": "ICMS Dev"
|
50
|
-
},
|
51
|
-
"searchInformation": {
|
52
|
-
"searchTime": 0.169486,
|
53
|
-
"formattedSearchTime": "0.17",
|
54
|
-
"totalResults": "40300000",
|
55
|
-
"formattedTotalResults": "40,300,000"
|
56
|
-
},
|
57
|
-
"items": [
|
58
|
-
{
|
59
|
-
"kind": "customsearch#result",
|
60
|
-
"title": "Poker -- from Wolfram MathWorld",
|
61
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e -- from Wolfram MathWorld",
|
62
|
-
"link": "http://mathworld.wolfram.com/Poker.html",
|
63
|
-
"displayLink": "mathworld.wolfram.com",
|
64
|
-
"snippet": "Poker is a card game played with a normal deck of 52 cards. Sometimes, additional cards called \"jokers\" are also used. In straight or draw poker, each player is ...",
|
65
|
-
"htmlSnippet": "\u003cb\u003ePoker\u003c/b\u003e is a card game played with a normal deck of 52 cards. Sometimes, \u003cbr\u003e additional cards called "jokers" are also used. In straight or draw \u003cb\u003epoker\u003c/b\u003e, each \u003cbr\u003e player is \u003cb\u003e...\u003c/b\u003e",
|
66
|
-
"cacheId": "5zu39T-W1XIJ",
|
67
|
-
"formattedUrl": "mathworld.wolfram.com/Poker.html",
|
68
|
-
"htmlFormattedUrl": "mathworld.wolfram.com/\u003cb\u003ePoker\u003c/b\u003e.html",
|
69
|
-
"pagemap": {
|
70
|
-
"metatags": [
|
71
|
-
{
|
72
|
-
"dc.creator": "Weisstein, Eric W.",
|
73
|
-
"dc.description": "Poker is a card game played with a normal deck of 52 cards. Sometimes, additional cards called \"jokers\" are also used. In straight or draw poker, each player is normally dealt a hand of five cards. Depending on the variant, players then discard and redraw cards, trying to improve their hands. Bets are placed at each discard step. The number of possible distinct five-card hands is equal to the number of possible ways of picking five cards out of a deck of 52, namely N=(52;...",
|
74
|
-
"dc.date.modified": "2002-06-21",
|
75
|
-
"dc.subject": "Mathematics:Recreational Mathematics:Games:Card Games",
|
76
|
-
"dc.rights": "Copyright 1999-2012 Wolfram Research, Inc. See http://mathworld.wolfram.com/about/terms.html for a full terms of use statement.",
|
77
|
-
"dc.format": "text/html",
|
78
|
-
"dc.identifier": "http://mathworld.wolfram.com/Poker.html",
|
79
|
-
"dc.language": "en",
|
80
|
-
"dc.publisher": "Wolfram Research, Inc.",
|
81
|
-
"dc.relation.ispartof": "http://mathworld.wolfram.com/",
|
82
|
-
"dc.type": "Text",
|
83
|
-
"last-modified": "2002-11-14"
|
84
|
-
}
|
85
|
-
]
|
86
|
-
}
|
87
|
-
},
|
88
|
-
{
|
89
|
-
"kind": "customsearch#result",
|
90
|
-
"title": "PokerStrategy.com - Learn the best Online Poker Strategy",
|
91
|
-
"htmlTitle": "PokerStrategy.com - Learn the best Online \u003cb\u003ePoker\u003c/b\u003e Strategy",
|
92
|
-
"link": "http://www.pokerstrategy.com/",
|
93
|
-
"displayLink": "www.pokerstrategy.com",
|
94
|
-
"snippet": "Learn poker at PokerStrategy.com, the worlds biggest Poker school. Beginners receive free starting capital to start off their poker careers!",
|
95
|
-
"htmlSnippet": "Learn \u003cb\u003epoker\u003c/b\u003e at PokerStrategy.com, the worlds biggest \u003cb\u003ePoker\u003c/b\u003e school. Beginners \u003cbr\u003e receive free starting capital to start off their \u003cb\u003epoker\u003c/b\u003e careers!",
|
96
|
-
"cacheId": "2U71Fnm3-JwJ",
|
97
|
-
"formattedUrl": "www.pokerstrategy.com/",
|
98
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003estrategy.com/"
|
99
|
-
},
|
100
|
-
{
|
101
|
-
"kind": "customsearch#result",
|
102
|
-
"title": "Play Online Poker at Cake Poker - Get A Piece of the Action",
|
103
|
-
"htmlTitle": "Play Online \u003cb\u003ePoker\u003c/b\u003e at Cake \u003cb\u003ePoker\u003c/b\u003e - Get A Piece of the Action",
|
104
|
-
"link": "http://cakepoker.eu/",
|
105
|
-
"displayLink": "cakepoker.eu",
|
106
|
-
"snippet": "Cake Poker provides the best online poker bonuses and rewards. Download the Cake Poker Room software and enjoy the tastiest poker room online.",
|
107
|
-
"htmlSnippet": "Cake \u003cb\u003ePoker\u003c/b\u003e provides the best online \u003cb\u003epoker\u003c/b\u003e bonuses and rewards. Download the \u003cbr\u003e Cake \u003cb\u003ePoker\u003c/b\u003e Room software and enjoy the tastiest \u003cb\u003epoker\u003c/b\u003e room online.",
|
108
|
-
"cacheId": "2cibuXjNjhkJ",
|
109
|
-
"formattedUrl": "cakepoker.eu/",
|
110
|
-
"htmlFormattedUrl": "cake\u003cb\u003epoker\u003c/b\u003e.eu/",
|
111
|
-
"pagemap": {
|
112
|
-
"metatags": [
|
113
|
-
{
|
114
|
-
"y_key": "b24bb5e8aa425c80",
|
115
|
-
"msvalidate.01": "34C0B2F0F48E94F89EDB1F7057D9E2FB"
|
116
|
-
}
|
117
|
-
]
|
118
|
-
}
|
119
|
-
},
|
120
|
-
{
|
121
|
-
"kind": "customsearch#result",
|
122
|
-
"title": "Play Poker Online - Compare Poker Rooms Before You Play Online ...",
|
123
|
-
"htmlTitle": "Play \u003cb\u003ePoker\u003c/b\u003e Online - Compare \u003cb\u003ePoker\u003c/b\u003e Rooms Before You Play Online \u003cb\u003e...\u003c/b\u003e",
|
124
|
-
"link": "http://www.pokerlistings.com/play-poker",
|
125
|
-
"displayLink": "www.pokerlistings.com",
|
126
|
-
"snippet": "Find The Best Poker Rooms to Play Poker Online. Over 100 Expert Room Reviews, Toplists and the Highest Bonuses Available. Download Software and Get ...",
|
127
|
-
"htmlSnippet": "Find The Best \u003cb\u003ePoker\u003c/b\u003e Rooms to Play \u003cb\u003ePoker\u003c/b\u003e Online. Over 100 Expert Room \u003cbr\u003e Reviews, Toplists and the Highest Bonuses Available. Download Software and \u003cbr\u003e Get \u003cb\u003e...\u003c/b\u003e",
|
128
|
-
"cacheId": "wH8zbGi1cigJ",
|
129
|
-
"formattedUrl": "www.pokerlistings.com/play-poker",
|
130
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003elistings.com/play-\u003cb\u003epoker\u003c/b\u003e",
|
131
|
-
"pagemap": {
|
132
|
-
"cse_image": [
|
133
|
-
{
|
134
|
-
"src": "http://edge1.pokerlistings.com/assets/photos/_resampled/CroppedImage320180-player-at-computer-18082.jpg"
|
135
|
-
}
|
136
|
-
],
|
137
|
-
"cse_thumbnail": [
|
138
|
-
{
|
139
|
-
"width": "256",
|
140
|
-
"height": "144",
|
141
|
-
"src": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcRBPbMv53wrbzcs0ipIX90s5Xk2sju1boWN4f3IcQuDASdwhgwoaChlgXKG"
|
142
|
-
}
|
143
|
-
]
|
144
|
-
}
|
145
|
-
},
|
146
|
-
{
|
147
|
-
"kind": "customsearch#result",
|
148
|
-
"title": "Poker Chips, Poker Tables, Wholesale Poker Supplies",
|
149
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e Chips, \u003cb\u003ePoker\u003c/b\u003e Tables, Wholesale \u003cb\u003ePoker\u003c/b\u003e Supplies",
|
150
|
-
"link": "http://www.pokernstuff.com/",
|
151
|
-
"displayLink": "www.pokernstuff.com",
|
152
|
-
"snippet": "Poker N Stuff is your ultimate poker shop for wholesale poker supplies. We offer the widest range of poker chips, poker chip sets, poker tables and playing cards.",
|
153
|
-
"htmlSnippet": "\u003cb\u003ePoker\u003c/b\u003e N Stuff is your ultimate \u003cb\u003epoker\u003c/b\u003e shop for wholesale \u003cb\u003epoker\u003c/b\u003e supplies. We offer \u003cbr\u003e the widest range of \u003cb\u003epoker\u003c/b\u003e chips, \u003cb\u003epoker\u003c/b\u003e chip sets, \u003cb\u003epoker\u003c/b\u003e tables and playing cards.",
|
154
|
-
"cacheId": "DpYnRid4fMsJ",
|
155
|
-
"formattedUrl": "www.pokernstuff.com/",
|
156
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003enstuff.com/",
|
157
|
-
"pagemap": {
|
158
|
-
"cse_image": [
|
159
|
-
{
|
160
|
-
"src": "http://www.pokernstuff.com/images/products/thumb/HT-OSWH-SUBLACK-TN.jpg"
|
161
|
-
}
|
162
|
-
],
|
163
|
-
"cse_thumbnail": [
|
164
|
-
{
|
165
|
-
"width": "120",
|
166
|
-
"height": "80",
|
167
|
-
"src": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcS6Wh6nvbqbeSAJCC8YxO7xd94_tuw_1u4Kn66BTEpBXecf9A0kC_P5vw"
|
168
|
-
}
|
169
|
-
],
|
170
|
-
"website": [
|
171
|
-
{
|
172
|
-
"description": "Poker N Stuff is your ultimate poker shop for wholesale poker supplies. We offer the widest range of poker chips, poker chip sets, poker tables and playing cards.",
|
173
|
-
"image": "http://www.pokernstuff.com/themes/migration-1/images/layout/site_logo.gif",
|
174
|
-
"title": "Poker N Stuff - Poker Chips, Poker Tables, Wholesale Poker Supplies",
|
175
|
-
"site_name": "Poker N Stuff - Poker Chips, Poker Tables, Wholesale Poker Supplies",
|
176
|
-
"url": "http://www.pokernstuff.com/",
|
177
|
-
"type": "website"
|
178
|
-
}
|
179
|
-
],
|
180
|
-
"metatags": [
|
181
|
-
{
|
182
|
-
"og:description": "Poker N Stuff is your ultimate poker shop for wholesale poker supplies. We offer the widest range of poker chips, poker chip sets, poker tables and playing cards.",
|
183
|
-
"og:image": "http://www.pokernstuff.com/themes/migration-1/images/layout/site_logo.gif",
|
184
|
-
"og:title": "Poker N Stuff - Poker Chips, Poker Tables, Wholesale Poker Supplies",
|
185
|
-
"og:site_name": "Poker N Stuff - Poker Chips, Poker Tables, Wholesale Poker Supplies",
|
186
|
-
"og:url": "http://www.pokernstuff.com/",
|
187
|
-
"og:type": "website"
|
188
|
-
}
|
189
|
-
]
|
190
|
-
}
|
191
|
-
},
|
192
|
-
{
|
193
|
-
"kind": "customsearch#result",
|
194
|
-
"title": "Online Poker Room - PKROUNDERS",
|
195
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e Room - PKROUNDERS",
|
196
|
-
"link": "http://www.pkrounders.com/",
|
197
|
-
"displayLink": "www.pkrounders.com",
|
198
|
-
"snippet": "Whatever your passion, PKRounders.com will take you front and center to a world-class dynamic poker community, PKRounders.com offers its players a simple, ...",
|
199
|
-
"htmlSnippet": "Whatever your passion, PKRounders.com will take you front and center to a \u003cbr\u003e world-class dynamic \u003cb\u003epoker\u003c/b\u003e community, PKRounders.com offers its players a \u003cbr\u003e simple, \u003cb\u003e...\u003c/b\u003e",
|
200
|
-
"cacheId": "1nF6s1pw3d4J",
|
201
|
-
"formattedUrl": "www.pkrounders.com/",
|
202
|
-
"htmlFormattedUrl": "www.pkrounders.com/",
|
203
|
-
"pagemap": {
|
204
|
-
"cse_image": [
|
205
|
-
{
|
206
|
-
"src": "http://www.pkrounders.com/images/new/instantplay.jpg"
|
207
|
-
}
|
208
|
-
],
|
209
|
-
"cse_thumbnail": [
|
210
|
-
{
|
211
|
-
"width": "308",
|
212
|
-
"height": "143",
|
213
|
-
"src": "https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcTjOvo70AsrXfhwWFW8O5vpZsemsoswJvOS-u5OK_hBZzwjar8xOkAvOxIC"
|
214
|
-
}
|
215
|
-
]
|
216
|
-
}
|
217
|
-
},
|
218
|
-
{
|
219
|
-
"kind": "customsearch#result",
|
220
|
-
"title": "Online Poker Room CelebPoker - Play Texas Holdem Games",
|
221
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e Room CelebPoker - Play Texas Holdem Games",
|
222
|
-
"link": "http://www.celebpoker.com/",
|
223
|
-
"displayLink": "www.celebpoker.com",
|
224
|
-
"snippet": "Online poker room CelebPoker offers players a wide range of poker games online to suit all levels of play. Experience the best poker tournaments, freerolls, ...",
|
225
|
-
"htmlSnippet": "Online \u003cb\u003epoker\u003c/b\u003e room CelebPoker offers players a wide range of \u003cb\u003epoker\u003c/b\u003e games \u003cbr\u003e online to suit all levels of play. Experience the best \u003cb\u003epoker\u003c/b\u003e tournaments, freerolls, \u003cb\u003e...\u003c/b\u003e",
|
226
|
-
"cacheId": "YvzWpeay9gYJ",
|
227
|
-
"formattedUrl": "www.celebpoker.com/",
|
228
|
-
"htmlFormattedUrl": "www.celeb\u003cb\u003epoker\u003c/b\u003e.com/",
|
229
|
-
"pagemap": {
|
230
|
-
"cse_image": [
|
231
|
-
{
|
232
|
-
"src": "http://www.celebpoker.com/images/homepage/online-poker-600.jpg"
|
233
|
-
}
|
234
|
-
],
|
235
|
-
"cse_thumbnail": [
|
236
|
-
{
|
237
|
-
"width": "379",
|
238
|
-
"height": "133",
|
239
|
-
"src": "https://encrypted-tbn2.google.com/images?q=tbn:ANd9GcT8ru5O1ZRnIL1mkYRMwNWlO3ch3dlbjXlljCJpCd17EUrN7FOu0nXl2dk"
|
240
|
-
}
|
241
|
-
],
|
242
|
-
"metatags": [
|
243
|
-
{
|
244
|
-
"title": "Online Poker Room CelebPoker - Play Texas Holdem Games"
|
245
|
-
}
|
246
|
-
]
|
247
|
-
}
|
248
|
-
},
|
249
|
-
{
|
250
|
-
"kind": "customsearch#result",
|
251
|
-
"title": "888Poker - Play Online Poker at Australia's Top Poker Room",
|
252
|
-
"htmlTitle": "888Poker - Play Online \u003cb\u003ePoker\u003c/b\u003e at Australia's Top \u003cb\u003ePoker\u003c/b\u003e Room",
|
253
|
-
"link": "http://au.888.com/",
|
254
|
-
"displayLink": "au.888.com",
|
255
|
-
"snippet": "Australian poker players - play online poker at 888poker and get $8 FREE to play exciting poker online tournaments with the new PokerCam and PokerTeams™ ...",
|
256
|
-
"htmlSnippet": "Australian \u003cb\u003epoker\u003c/b\u003e players - play online \u003cb\u003epoker\u003c/b\u003e at 888poker and get $8 FREE to play \u003cbr\u003e exciting \u003cb\u003epoker\u003c/b\u003e online tournaments with the new PokerCam and PokerTeams™ \u003cb\u003e...\u003c/b\u003e",
|
257
|
-
"cacheId": "rVeWsJKz7kAJ",
|
258
|
-
"formattedUrl": "au.888.com/",
|
259
|
-
"htmlFormattedUrl": "au.888.com/",
|
260
|
-
"pagemap": {
|
261
|
-
"metatags": [
|
262
|
-
{
|
263
|
-
"y_key": "6f6da0d7f2b30903",
|
264
|
-
"msvalidate.01": "07488F7512B6843DA133BFCCED4C6397",
|
265
|
-
"dc.title": "888.com in Australia | 888.com Poker"
|
266
|
-
}
|
267
|
-
]
|
268
|
-
}
|
269
|
-
},
|
270
|
-
{
|
271
|
-
"kind": "customsearch#result",
|
272
|
-
"title": "Poker News - Topix",
|
273
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e News - Topix",
|
274
|
-
"link": "http://www.topix.com/games/poker",
|
275
|
-
"displayLink": "www.topix.com",
|
276
|
-
"snippet": "News on Poker continually updated from thousands of sources around the net.",
|
277
|
-
"htmlSnippet": "News on \u003cb\u003ePoker\u003c/b\u003e continually updated from thousands of sources around the net.",
|
278
|
-
"cacheId": "exS21uqw_WoJ",
|
279
|
-
"formattedUrl": "www.topix.com/games/poker",
|
280
|
-
"htmlFormattedUrl": "www.topix.com/games/\u003cb\u003epoker\u003c/b\u003e",
|
281
|
-
"pagemap": {
|
282
|
-
"metatags": [
|
283
|
-
{
|
284
|
-
"viewport": "width=980, user-scalable=yes"
|
285
|
-
}
|
286
|
-
]
|
287
|
-
}
|
288
|
-
},
|
289
|
-
{
|
290
|
-
"kind": "customsearch#result",
|
291
|
-
"title": "Poker probability - Wikipedia, the free encyclopedia",
|
292
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e probability - Wikipedia, the free encyclopedia",
|
293
|
-
"link": "http://en.wikipedia.org/wiki/Poker_probability",
|
294
|
-
"displayLink": "en.wikipedia.org",
|
295
|
-
"snippet": "In poker, the probability of each type of 5-card hand can be computed by calculating the proportion of hands of that type among all possible hands.",
|
296
|
-
"htmlSnippet": "In \u003cb\u003epoker\u003c/b\u003e, the probability of each type of 5-card hand can be computed by \u003cbr\u003e calculating the proportion of hands of that type among all possible hands.",
|
297
|
-
"cacheId": "hx5DD8WItogJ",
|
298
|
-
"formattedUrl": "en.wikipedia.org/wiki/Poker_probability",
|
299
|
-
"htmlFormattedUrl": "en.wikipedia.org/wiki/\u003cb\u003ePoker\u003c/b\u003e_probability"
|
300
|
-
}
|
301
|
-
]
|
302
|
-
}
|
data/spec/fixtures/poker_91.json
DELETED
@@ -1,238 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"kind": "customsearch#search",
|
3
|
-
"url": {
|
4
|
-
"type": "application/json",
|
5
|
-
"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"
|
6
|
-
},
|
7
|
-
"queries": {
|
8
|
-
"request": [
|
9
|
-
{
|
10
|
-
"title": "Google Custom Search - poker",
|
11
|
-
"totalResults": "40300000",
|
12
|
-
"searchTerms": "poker",
|
13
|
-
"count": 10,
|
14
|
-
"startIndex": 91,
|
15
|
-
"inputEncoding": "utf8",
|
16
|
-
"outputEncoding": "utf8",
|
17
|
-
"safe": "off",
|
18
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
19
|
-
}
|
20
|
-
],
|
21
|
-
"previousPage": [
|
22
|
-
{
|
23
|
-
"title": "Google Custom Search - poker",
|
24
|
-
"totalResults": "40300000",
|
25
|
-
"searchTerms": "poker",
|
26
|
-
"count": 10,
|
27
|
-
"startIndex": 81,
|
28
|
-
"inputEncoding": "utf8",
|
29
|
-
"outputEncoding": "utf8",
|
30
|
-
"safe": "off",
|
31
|
-
"cx": "002432975944642411257:ztx9u0hzbcw"
|
32
|
-
}
|
33
|
-
]
|
34
|
-
},
|
35
|
-
"context": {
|
36
|
-
"title": "ICMS Dev"
|
37
|
-
},
|
38
|
-
"searchInformation": {
|
39
|
-
"searchTime": 0.191408,
|
40
|
-
"formattedSearchTime": "0.19",
|
41
|
-
"totalResults": "40300000",
|
42
|
-
"formattedTotalResults": "40,300,000"
|
43
|
-
},
|
44
|
-
"items": [
|
45
|
-
{
|
46
|
-
"kind": "customsearch#result",
|
47
|
-
"title": "Two Plus Two Poker Forum - Poker Strategy Forums",
|
48
|
-
"htmlTitle": "Two Plus Two \u003cb\u003ePoker\u003c/b\u003e Forum - \u003cb\u003ePoker\u003c/b\u003e Strategy Forums",
|
49
|
-
"link": "http://forumserver.twoplustwo.com/",
|
50
|
-
"displayLink": "forumserver.twoplustwo.com",
|
51
|
-
"snippet": "Poker discussion forum with over 250000 members and 100 different poker forums. Learn poker strategy & sharpen your poker skills for tournament poker, texas ...",
|
52
|
-
"htmlSnippet": "\u003cb\u003ePoker\u003c/b\u003e discussion forum with over 250000 members and 100 different \u003cb\u003epoker\u003c/b\u003e \u003cbr\u003e forums. Learn \u003cb\u003epoker\u003c/b\u003e strategy & sharpen your \u003cb\u003epoker\u003c/b\u003e skills for tournament \u003cb\u003epoker\u003c/b\u003e, \u003cbr\u003e texas \u003cb\u003e...\u003c/b\u003e",
|
53
|
-
"cacheId": "jCZFwmGLCuYJ",
|
54
|
-
"formattedUrl": "forumserver.twoplustwo.com/",
|
55
|
-
"htmlFormattedUrl": "forumserver.twoplustwo.com/"
|
56
|
-
},
|
57
|
-
{
|
58
|
-
"kind": "customsearch#result",
|
59
|
-
"title": "Fundoo Poker - India's number one poker portal!",
|
60
|
-
"htmlTitle": "Fundoo \u003cb\u003ePoker\u003c/b\u003e - India's number one \u003cb\u003epoker\u003c/b\u003e portal!",
|
61
|
-
"link": "http://www.fundoopoker.com/",
|
62
|
-
"displayLink": "www.fundoopoker.com",
|
63
|
-
"snippet": "At FundooPoker.com we are committed to providing the best, most useful and accurate ...",
|
64
|
-
"htmlSnippet": "At FundooPoker.com we are committed to providing the best, most useful and accurate \u003cb\u003e...\u003c/b\u003e"
|
65
|
-
},
|
66
|
-
{
|
67
|
-
"kind": "customsearch#result",
|
68
|
-
"title": "World Tavern Poker America's #1 Bar Poker League",
|
69
|
-
"htmlTitle": "World Tavern \u003cb\u003ePoker\u003c/b\u003e America's #1 Bar \u003cb\u003ePoker\u003c/b\u003e League",
|
70
|
-
"link": "http://www.worldtavernpoker.com/",
|
71
|
-
"displayLink": "www.worldtavernpoker.com",
|
72
|
-
"snippet": "REFER A BAR · INVITE A FRIEND · PHOTO GALLERY · HALL OF FAME · POKER PICK UP LINES · WORLD TAVERN OPEN · POKER SUPPLIES - BAR · COOL ...",
|
73
|
-
"htmlSnippet": "REFER A BAR · INVITE A FRIEND · PHOTO GALLERY · HALL OF FAME · \u003cbr\u003e \u003cb\u003ePOKER\u003c/b\u003e PICK UP LINES · WORLD TAVERN OPEN · \u003cb\u003ePOKER\u003c/b\u003e SUPPLIES - BAR · \u003cbr\u003e COOL \u003cb\u003e...\u003c/b\u003e",
|
74
|
-
"cacheId": "wJJqkbvCx6cJ",
|
75
|
-
"formattedUrl": "www.worldtavernpoker.com/",
|
76
|
-
"htmlFormattedUrl": "www.worldtavern\u003cb\u003epoker\u003c/b\u003e.com/",
|
77
|
-
"pagemap": {
|
78
|
-
"cse_image": [
|
79
|
-
{
|
80
|
-
"src": "http://www.worldtavernpoker.com/Admin/uploads/image/TOC-Logo.jpg"
|
81
|
-
}
|
82
|
-
],
|
83
|
-
"cse_thumbnail": [
|
84
|
-
{
|
85
|
-
"width": "170",
|
86
|
-
"height": "128",
|
87
|
-
"src": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcS9HpBmspaWOd4GZg7xMV1sZMZzrAMxfPdmCHvRG34ZOUBvd-P-YcIpfi8"
|
88
|
-
}
|
89
|
-
]
|
90
|
-
}
|
91
|
-
},
|
92
|
-
{
|
93
|
-
"kind": "customsearch#result",
|
94
|
-
"title": "Sky Poker - Play Online Poker and Free Poker - Up to £1000 FREE!",
|
95
|
-
"htmlTitle": "Sky \u003cb\u003ePoker\u003c/b\u003e - Play Online \u003cb\u003ePoker\u003c/b\u003e and Free \u003cb\u003ePoker\u003c/b\u003e - Up to £1000 FREE!",
|
96
|
-
"link": "http://www.skypoker.com/",
|
97
|
-
"displayLink": "www.skypoker.com",
|
98
|
-
"snippet": "For free poker join Sky Poker! Get up to a £1000 Welcome Bonus plus £10 absolutely free. Play online poker and compete with players at every level across the ...",
|
99
|
-
"htmlSnippet": "For free \u003cb\u003epoker\u003c/b\u003e join Sky \u003cb\u003ePoker\u003c/b\u003e! Get up to a £1000 Welcome Bonus plus £10 \u003cbr\u003e absolutely free. Play online \u003cb\u003epoker\u003c/b\u003e and compete with players at every level across \u003cbr\u003e the \u003cb\u003e...\u003c/b\u003e",
|
100
|
-
"cacheId": "bweveMgGImYJ",
|
101
|
-
"formattedUrl": "www.skypoker.com/",
|
102
|
-
"htmlFormattedUrl": "www.sky\u003cb\u003epoker\u003c/b\u003e.com/",
|
103
|
-
"pagemap": {
|
104
|
-
"cse_image": [
|
105
|
-
{
|
106
|
-
"src": "http://www.skypoker.com/img/cms/211x123welcome180211.jpg"
|
107
|
-
}
|
108
|
-
],
|
109
|
-
"cse_thumbnail": [
|
110
|
-
{
|
111
|
-
"width": "168",
|
112
|
-
"height": "98",
|
113
|
-
"src": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcQYhP7Y11iPjCfU9tJKuFvR4tKKX-VxGLSloLGg5miI5LnxX2OJ3JGP2w"
|
114
|
-
}
|
115
|
-
],
|
116
|
-
"metatags": [
|
117
|
-
{
|
118
|
-
"copyright": "2008 BSkyB; All Rights Reserved"
|
119
|
-
}
|
120
|
-
]
|
121
|
-
}
|
122
|
-
},
|
123
|
-
{
|
124
|
-
"kind": "customsearch#result",
|
125
|
-
"title": "Online poker guide, exclusive bonuses from best poker rooms ...",
|
126
|
-
"htmlTitle": "Online \u003cb\u003epoker\u003c/b\u003e guide, exclusive bonuses from best \u003cb\u003epoker\u003c/b\u003e rooms \u003cb\u003e...\u003c/b\u003e",
|
127
|
-
"link": "http://www.launchpoker.com/",
|
128
|
-
"displayLink": "www.launchpoker.com",
|
129
|
-
"snippet": "Comprehensive online poker guide at LaunchPoker.com - poker rules, online poker room reviews, and poker tips on how to play poker.",
|
130
|
-
"htmlSnippet": "Comprehensive online \u003cb\u003epoker\u003c/b\u003e guide at LaunchPoker.com - \u003cb\u003epoker\u003c/b\u003e rules, online \u003cbr\u003e \u003cb\u003epoker\u003c/b\u003e room reviews, and \u003cb\u003epoker\u003c/b\u003e tips on how to play \u003cb\u003epoker\u003c/b\u003e.",
|
131
|
-
"cacheId": "zrVQMcZENZsJ",
|
132
|
-
"formattedUrl": "www.launchpoker.com/",
|
133
|
-
"htmlFormattedUrl": "www.launch\u003cb\u003epoker\u003c/b\u003e.com/",
|
134
|
-
"pagemap": {
|
135
|
-
"cse_image": [
|
136
|
-
{
|
137
|
-
"src": "http://www.launchpoker.com/files/images/Chips%20and%20Cards_5.jpg"
|
138
|
-
}
|
139
|
-
],
|
140
|
-
"cse_thumbnail": [
|
141
|
-
{
|
142
|
-
"width": "275",
|
143
|
-
"height": "183",
|
144
|
-
"src": "https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcRD04jSeP1uW2_p9zJi0ZEBCy3_n7ce9-OaMvhnoNhHGqCASGQX359kXek"
|
145
|
-
}
|
146
|
-
]
|
147
|
-
}
|
148
|
-
},
|
149
|
-
{
|
150
|
-
"kind": "customsearch#result",
|
151
|
-
"title": "Poker Rules for Beginners l Get All the Official Rules of Poker",
|
152
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e Rules for Beginners l Get All the Official Rules of \u003cb\u003ePoker\u003c/b\u003e",
|
153
|
-
"link": "http://www.pokerlistings.com/poker-rules",
|
154
|
-
"displayLink": "www.pokerlistings.com",
|
155
|
-
"snippet": "Learn poker rules quickly with PokerListings' easy-to-understand guide to the official rules of poker – Texas Holdem, Omaha, 7 Card Stud and more covered.",
|
156
|
-
"htmlSnippet": "Learn \u003cb\u003epoker\u003c/b\u003e rules quickly with PokerListings' easy-to-understand guide to the \u003cbr\u003e official rules of \u003cb\u003epoker\u003c/b\u003e – Texas Holdem, Omaha, 7 Card Stud and more covered.",
|
157
|
-
"cacheId": "TF8HL569zyQJ",
|
158
|
-
"formattedUrl": "www.pokerlistings.com/poker-rules",
|
159
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003elistings.com/\u003cb\u003epoker\u003c/b\u003e-rules",
|
160
|
-
"pagemap": {
|
161
|
-
"cse_image": [
|
162
|
-
{
|
163
|
-
"src": "http://edge1.pokerlistings.com/images/WHWCalculator.jpg"
|
164
|
-
}
|
165
|
-
],
|
166
|
-
"cse_thumbnail": [
|
167
|
-
{
|
168
|
-
"width": "235",
|
169
|
-
"height": "154",
|
170
|
-
"src": "https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcQCWaFJ4zcTm0JPjpV1V7aJVKLckx1VTX6D7jq2XuO37t6kcyA_Ij4llVGA"
|
171
|
-
}
|
172
|
-
]
|
173
|
-
}
|
174
|
-
},
|
175
|
-
{
|
176
|
-
"kind": "customsearch#result",
|
177
|
-
"title": "Glossary of poker terms - Wikipedia, the free encyclopedia",
|
178
|
-
"htmlTitle": "Glossary of \u003cb\u003epoker\u003c/b\u003e terms - Wikipedia, the free encyclopedia",
|
179
|
-
"link": "http://en.wikipedia.org/wiki/Glossary_of_poker_terms",
|
180
|
-
"displayLink": "en.wikipedia.org",
|
181
|
-
"snippet": "The following is a glossary of poker terms used in the card game of poker. It supplements the Glossary of card terms. Besides the terms listed here, there are ...",
|
182
|
-
"htmlSnippet": "The following is a glossary of \u003cb\u003epoker\u003c/b\u003e terms used in the card game of \u003cb\u003epoker\u003c/b\u003e. It \u003cbr\u003e supplements the Glossary of card terms. Besides the terms listed here, there are \u003cb\u003e...\u003c/b\u003e",
|
183
|
-
"cacheId": "mYz7xnHj1C4J",
|
184
|
-
"formattedUrl": "en.wikipedia.org/wiki/Glossary_of_poker_terms",
|
185
|
-
"htmlFormattedUrl": "en.wikipedia.org/wiki/Glossary_of_\u003cb\u003epoker\u003c/b\u003e_terms"
|
186
|
-
},
|
187
|
-
{
|
188
|
-
"kind": "customsearch#result",
|
189
|
-
"title": "Online Poker - Play Free Online Poker Games At UB Poker Room",
|
190
|
-
"htmlTitle": "Online \u003cb\u003ePoker\u003c/b\u003e - Play Free Online \u003cb\u003ePoker\u003c/b\u003e Games At UB \u003cb\u003ePoker\u003c/b\u003e Room",
|
191
|
-
"link": "http://www.ubpoker.eu/",
|
192
|
-
"displayLink": "www.ubpoker.eu",
|
193
|
-
"snippet": "If you enjoy playing poker, you'll love the incredible selection of online poker games offered at UB. Formerly UltimateBet.com, UB offers the best free online ...",
|
194
|
-
"htmlSnippet": "If you enjoy playing \u003cb\u003epoker\u003c/b\u003e, you'll love the incredible selection of online \u003cb\u003epoker\u003c/b\u003e \u003cbr\u003e games offered at UB. Formerly UltimateBet.com, UB offers the best free online \u003cb\u003e...\u003c/b\u003e",
|
195
|
-
"cacheId": "dzmI8hTTn9wJ",
|
196
|
-
"formattedUrl": "www.ubpoker.eu/",
|
197
|
-
"htmlFormattedUrl": "www.ub\u003cb\u003epoker\u003c/b\u003e.eu/",
|
198
|
-
"pagemap": {
|
199
|
-
"cse_image": [
|
200
|
-
{
|
201
|
-
"src": "http://www.ubpoker.eu/sites/default/themes/ub/images/common/home/video-preview-home.jpg"
|
202
|
-
}
|
203
|
-
],
|
204
|
-
"cse_thumbnail": [
|
205
|
-
{
|
206
|
-
"width": "214",
|
207
|
-
"height": "120",
|
208
|
-
"src": "https://encrypted-tbn2.google.com/images?q=tbn:ANd9GcRECQGgCP-5fBgOnu627EJMX6biaLeLz7mFJGFSCLldrvTkYjkizow1RA"
|
209
|
-
}
|
210
|
-
]
|
211
|
-
}
|
212
|
-
},
|
213
|
-
{
|
214
|
-
"kind": "customsearch#result",
|
215
|
-
"title": "Poker Tracker",
|
216
|
-
"htmlTitle": "\u003cb\u003ePoker\u003c/b\u003e Tracker",
|
217
|
-
"link": "http://www.pokertracker.com/",
|
218
|
-
"displayLink": "www.pokertracker.com",
|
219
|
-
"snippet": "Shareware statistical program for analyzing Texas Hold'em play using hand histories. [Win]",
|
220
|
-
"htmlSnippet": "Shareware statistical program for analyzing Texas Hold'em play using hand \u003cbr\u003e histories. [Win]",
|
221
|
-
"cacheId": "cqn2JxUSex4J",
|
222
|
-
"formattedUrl": "www.pokertracker.com/",
|
223
|
-
"htmlFormattedUrl": "www.\u003cb\u003epoker\u003c/b\u003etracker.com/"
|
224
|
-
},
|
225
|
-
{
|
226
|
-
"kind": "customsearch#result",
|
227
|
-
"title": "SeriousPoker.com - Dan's Poker Dictionary",
|
228
|
-
"htmlTitle": "SeriousPoker.com - Dan's \u003cb\u003ePoker\u003c/b\u003e Dictionary",
|
229
|
-
"link": "http://www.seriouspoker.com/dictionary.html",
|
230
|
-
"displayLink": "www.seriouspoker.com",
|
231
|
-
"snippet": "In games played for low, an unpaired low hand is referred to by its highest card, often its highest two cards and sometimes more if needed. So 8432A (in ace to ...",
|
232
|
-
"htmlSnippet": "In games played for low, an unpaired low hand is referred to by its highest card, \u003cbr\u003e often its highest two cards and sometimes more if needed. So 8432A (in ace to \u003cb\u003e...\u003c/b\u003e",
|
233
|
-
"cacheId": "Sgro5g5ojoMJ",
|
234
|
-
"formattedUrl": "www.seriouspoker.com/dictionary.html",
|
235
|
-
"htmlFormattedUrl": "www.serious\u003cb\u003epoker\u003c/b\u003e.com/dictionary.html"
|
236
|
-
}
|
237
|
-
]
|
238
|
-
}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
|
3
|
-
describe "GoogleCustomSearchApi" do
|
4
|
-
before :each do
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should be able to run a poker search" do
|
9
|
-
json = JSON.parse(File.read("#{File.dirname(__FILE__)}/fixtures/poker.json"))
|
10
|
-
stub_request(:get, "https://www.googleapis.com/customsearch/v1?alt=json&cx=123&key=abc&q=poker").
|
11
|
-
to_return(:status => 200, :body => json, :headers => {})
|
12
|
-
res = GoogleCustomSearchApi.search("poker")
|
13
|
-
res.items.size.should == 10
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should be able to run an empty search" do
|
17
|
-
json = JSON.parse(File.read("#{File.dirname(__FILE__)}/fixtures/empty.json"))
|
18
|
-
stub_request(:get, "https://www.googleapis.com/customsearch/v1?alt=json&cx=123&key=abc&q=asdfqwerzxcvr").
|
19
|
-
to_return(:status => 200, :body => json, :headers => {})
|
20
|
-
res = GoogleCustomSearchApi.search("asdfqwerzxcvr")
|
21
|
-
res.items.size.should == 0
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should be able to alter start" do
|
25
|
-
json = JSON.parse(File.read("#{File.dirname(__FILE__)}/fixtures/poker_81.json"))
|
26
|
-
stub_request(:get, "https://www.googleapis.com/customsearch/v1?alt=json&cx=123&key=abc&q=poker&start=81").
|
27
|
-
to_return(:status => 200, :body => json, :headers => {})
|
28
|
-
res = GoogleCustomSearchApi.search("poker", :start => 81)
|
29
|
-
res.items.size.should == 10
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should be able to get all results" do
|
33
|
-
json1 = JSON.parse(File.read("#{File.dirname(__FILE__)}/fixtures/poker_81.json"))
|
34
|
-
stub_request(:get, "https://www.googleapis.com/customsearch/v1?alt=json&cx=123&key=abc&q=poker&start=81").
|
35
|
-
to_return(:status => 200, :body => json1, :headers => {})
|
36
|
-
|
37
|
-
json2 = JSON.parse(File.read("#{File.dirname(__FILE__)}/fixtures/poker_91.json"))
|
38
|
-
stub_request(:get, "https://www.googleapis.com/customsearch/v1?alt=json&cx=123&key=abc&q=poker&start=91").
|
39
|
-
to_return(:status => 200, :body => json2, :headers => {})
|
40
|
-
|
41
|
-
res = GoogleCustomSearchApi.search_and_return_all_results("poker", :start => 81)
|
42
|
-
res.first.queries.nextPage.first.startIndex.to_s.should == "91"
|
43
|
-
res.last.queries.keys.include?("nextPage").should == false
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
$TESTING=true
|
2
|
-
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
require 'webmock/rspec'
|
6
|
-
require 'json'
|
7
|
-
require 'google_custom_search_api'
|
8
|
-
require 'httparty'
|
9
|
-
|
10
|
-
# from https://code.google.com/apis/console/b/0/?pli=1#project:853239283164:access
|
11
|
-
GOOGLE_API_KEY = 'abc'
|
12
|
-
|
13
|
-
# from http://www.google.com/cse/manage/all
|
14
|
-
GOOGLE_SEARCH_CX = "123"
|