searchbing 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/searchbing.rb +11 -2
- metadata +1 -1
data/lib/searchbing.rb
CHANGED
@@ -25,10 +25,11 @@ class Bing
|
|
25
25
|
attr_accessor :account_key, :num_results, :type
|
26
26
|
|
27
27
|
# Search for a term, the result is an array of hashes with the result data
|
28
|
-
# >> bing_image.search("puffin")
|
29
|
-
# => [{"__metadata"=>{"uri"=>"https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query='puffin'&$skip=
|
28
|
+
# >> bing_image.search("puffin", 25)
|
29
|
+
# => [{"__metadata"=>{"uri"=>"https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query='puffin'&$skip=25&$top=1", "type"=>"Image
|
30
30
|
# Arguments:
|
31
31
|
# search_term: (String)
|
32
|
+
# offset: (Integer)
|
32
33
|
|
33
34
|
def search(search_term, offset = 0)
|
34
35
|
|
@@ -50,3 +51,11 @@ class Bing
|
|
50
51
|
result_set = body["d"]["results"]
|
51
52
|
end
|
52
53
|
end
|
54
|
+
|
55
|
+
|
56
|
+
bing_image = Bing.new('MM6OD0qjozdOWWvspc0j4DRkn4JEBM0A/cEQFHDKTYo', 40, 'Image')
|
57
|
+
|
58
|
+
bing_results = bing_image.search("puffin", 60)
|
59
|
+
|
60
|
+
|
61
|
+
puts bing_results;
|