searchbing 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +9 -6
  3. data/lib/searchbing.rb +5 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTE3Y2VmNDhmM2M1MmNhMDZiZDgwYjc5ODYyNzE1NWY3YjgyMzg3OA==
4
+ YTU2ZGE5ZmRkZmI1NWNjZWEyNmM2ZGRjNjIxN2ExYjI0MWVlM2JlMg==
5
5
  data.tar.gz: !binary |-
6
- N2Q4ZTFiMTRkOTA2ODBjOTI5MWJlZTdlODgzNDkzODE1N2NlZmZkOA==
6
+ NGNhZDg1MTc0MGMzZmM2OGU5ZWYwN2M3MDdjNjI3ZTYwNjU5YjU0OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OTZkZmQ2MmFmNzAzMWEwOTkxMWU4N2RiNzMxMjY0ZjNlNDVhNDEzOTVjZWEy
10
- NDUyOTY0ZTIxYjIxNjg3ZTkzMGYyZGYyNjFiNDE1ZGQ2NGY1ODllNDFhM2M1
11
- YjlmZGVjOThmZDU0ZmM5NzA1Mjc4ZDQxMTg2ODBiYzlmNTNjM2U=
9
+ ZGJhOGJjM2Y3ODE1YWViZTc0YTZlMTRmNzI4ZjhmM2IzMTM2NGM1MDI1Mjhl
10
+ OTJlZThlNjFmY2RkOTUyYzQ2NjY2MGNiN2RjNTIyZGY1ZjdlZWRmOTBlMGVj
11
+ NWRlMjIxZDU1ZGRjYzNjM2U0YWJiZTNjNzg3N2M4NmQzNjg3Mzc=
12
12
  data.tar.gz: !binary |-
13
- MTNjZDFhZjgwNzdlZjQ2MWJkOThkNTY5NTVlMGMwNzU5ZjhiNDg2ZmQ3MTNm
14
- ZWEzNTc0ZTkxYjliNzE4MGFjMjQzMmIyOGQ2MTFiMDRkMDhlZTFiMTk1MGYz
15
- NDViYWEzMmI2NmNiOWI3YzE0NmVmY2MyY2UwZGU4ZmY5ZDM2MDg=
13
+ YmMwYzg2MDU2NmIyYmIyMjEzNTU3ZWIxZWU0MDhjMzBhYjc5OGFiMjRlMTFi
14
+ ZDhiNzEyMzYzZDVhYmQxZmY3OWYwMWE0MTUwZTQxYTg5Mjc0Mjc2NzA3MTk5
15
+ NWJlZTExMTUxMGMyNWViM2Y2OTQyYjI1Njk5YTVjOGM2NDU3MGQ=
data/README.md CHANGED
@@ -6,19 +6,22 @@ Usage
6
6
  ============
7
7
  1. create a new search object from the Bing class. Enter your recently obtained account key, the number of results you would like, and the search type.
8
8
  2. valid search types include: Image, Web, or Video. The first letter must be capitalized
9
+ 3. the searchbing gem relies on the open-uri, net/http, and json gems.
9
10
 
10
11
  Example
11
12
  ===============
12
- 1. Create a new search object
13
+ - Create a new search object
13
14
 
14
15
  animals = Bing.new('your_account_key_goes_here', 10, 'Image')
15
16
 
16
- 2. Retrieve the results for a given term
17
+ - Retrieve the results for a given term
17
18
 
18
- bing_results = animals.search("lion")
19
+ bing_results = animals.search("lion")
19
20
 
20
- 3. parse the result set depending on what you would like to retrive
21
+ - parse the result set depending on what you would like to retrive
22
+
23
+ puts bing_results[0]["MediaUrl"] # puts url of fullsize image
24
+
25
+ puts bing_results[0]["Thumbnail"]["MediaUrl"] # puts url of thumbnail
21
26
 
22
- puts result_set[0]["MediaUrl"] # puts url of fullsize image
23
- puts result_set[0]["Thumbnail"]["MediaUrl"] # puts url of thumbnail
24
27
 
data/lib/searchbing.rb CHANGED
@@ -49,4 +49,8 @@ class Bing
49
49
  body = JSON.parse(res.body)
50
50
  result_set = body["d"]["results"]
51
51
  end
52
- end
52
+ end
53
+
54
+ animals = Bing.new('MM6OD0qjozdOWWvspc0j4DRkn4JEBM0A/cEQFHDKTYo', 10, 'Image')
55
+ bing_results = animals.search("lion")
56
+ puts bing_results[0]["MediaUrl"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchbing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Culliton