bossman 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/README.md +43 -51
  2. metadata +1 -1
data/README.md CHANGED
@@ -4,70 +4,62 @@
4
4
 
5
5
  BOSSMan can be used to perform image, web and news searches against Yahoo's index. For more information about BOSS (Build your Own Search Service) please refer to http://developer.yahoo.com/search/boss/.
6
6
 
7
+ This is an older project - I'd encourage look at the great HTTParty (http://github.com/jnunemaker/httparty) library if you need to quickly and easily access HTTP resources.
8
+
7
9
  ## Bugs, Features, Feedback
8
10
 
9
- Feedback would be really appreciated. You can send it to me at john.pignata@gmail.com. Tickets can
10
- be submitted by using GitHub issues.
11
+ Tickets can be submitted by using GitHub issues.
11
12
 
12
13
  ## Example Usage
13
14
 
14
- ### Web
15
-
16
- require 'bossman'
17
- include BOSSMan
15
+ ### Setup
18
16
 
19
- BOSSMan.application_id = <Your Application ID>
17
+ require 'bossman'
18
+ include BOSSMan
20
19
 
21
- boss = BOSSMan::Search.web("prospect park", { :count => 5, :filter => "-hate" })
20
+ BOSSMan.application_id = [Your Application ID]
22
21
 
23
- puts "Number of results: #{boss.totalhits}"
24
- puts
22
+ ### Web
25
23
 
26
- boss.results.each do |result|
27
- puts "#{result.title}"
28
- puts "-" * 80
29
- puts "#{result.abstract}"
30
- puts
31
- end
24
+ boss = Search.web("prospect park", :count => 5, :filter => "-hate")
25
+
26
+ puts "Matches:"
27
+ puts
28
+
29
+ boss.results.each { |result| puts "#{result.title} [#{result.url}]" }
30
+
31
+ => Matches:
32
+
33
+ <b>Prospect</b> <b>Park</b> Alliance [http://www.prospectpark.org/]
34
+ <b>Prospect</b> <b>Park</b> (Brooklyn) - Wikipedia, the free encyclopedia [http://en.wikipedia.org/wiki/Prospect_Park_(Brooklyn)]
35
+ About <b>Prospect</b> <b>Park</b> [http://www.prospectpark.org/about]
36
+ <b>Prospect</b> <b>Park</b> Zoo [http://www.prospectparkzoo.com/]
37
+ <b>Prospect</b> <b>Park</b> [http://www.prospectpark.net/]
32
38
 
33
39
  ### News
34
40
 
35
- require 'bossman'
36
- include BOSSMan
37
-
38
- BOSSMan.application_id = <Your Application ID>
39
-
40
- boss = BOSSMan::Search.news("brooklyn new york", { :age => "7d" })
41
-
42
- boss.results.each do |result|
43
- puts "#{result.title} [from #{result.source}]"
44
- puts "-" * 80
45
- puts "#{result.abstract}"
46
- puts
41
+ boss = Search.news("brooklyn new york", :age => "1h")
42
+ puts boss.results.first.title
43
+ puts "-" * 80
44
+ puts boss.results.first.abstract
45
+
46
+ => Brooklyn Park Helps Homeless
47
+ --------------------------------------------------------------------------------
48
+ When people lose their homes, they often turn to shelters as a last resort. Now, the City of Broo...
47
49
 
48
50
  ### Images
49
51
 
50
- require 'bossman'
51
- include BOSSMan
52
+ boss = Search.images("brooklyn dumbo", :dimensions => "large")
53
+ boss.results.map { |result| result.url }
52
54
 
53
- BOSSMan.application_id = <Your Application ID>
54
-
55
- boss = BOSSMan::Search.images("brooklyn dumbo", { :dimensions => "large" })
56
-
57
- boss.results.each do |result|
58
- puts "#{result.url}: #{result.abstract}"
59
- end
60
-
55
+ => ["http://static.flickr.com/71/216529430_bf36a6c40b.jpg", "http://static.flickr.com/3215/2771873360_7cf2d7e572.jpg", "http://static.flickr.com/149/360481219_3ab59470cc.jpg", "http://static.flickr.com/3136/2768629082_bc0dcb76a3.jpg", "http://www.wirednewyork.com/brooklyn/dumbo/dumbo_brooklyn_bridge_3march02.jpg", "http://www.wirednewyork.com/brooklyn/dumbo/dumbo_brooklyn_bridge_plymouth_4july03.jpg", "http://static.flickr.com/3611/3538565901_f81eb52825.jpg", "http://static.flickr.com/2145/3539377152_1fd629db12.jpg", "http://static.flickr.com/2082/2340123052_fb8afe43b6.jpg", "http://static.flickr.com/3617/3508763096_ec8c53c061.jpg"]
56
+
61
57
  ### Spelling
62
58
 
63
- require 'bossman'
64
- include BOSSMan
65
-
66
- BOSSMan.application_id = <Your Application ID>
67
-
68
- boss = BOSSMan::Search.spelling("Diabretes")
69
-
70
- puts boss.suggestion
59
+ boss = Search.spelling("Diabretes")
60
+ boss.suggestion
61
+
62
+ => Diabetes
71
63
 
72
64
  ## Output Objects
73
65
 
@@ -121,22 +113,22 @@ be submitted by using GitHub issues.
121
113
 
122
114
  - search.suggestion : Returns spelling suggestion from BOSS
123
115
 
124
- ### Raw dump formats
116
+ ### Other formats
125
117
 
126
118
  Result sets can be dumped as JSON, XML and YAML by use of to_json, to_xml, to_yaml respectively.
127
119
 
128
120
  - search.to_xml : dumps XML of the result set
129
121
  - search.to_json : dumps JSON of the result set
130
122
  - search.to_yaml : dumps YAML of the result set
131
- - search.results[3] : dumps XML of one search result
123
+ - search.results[3].to_xml : dumps XML of one search result
132
124
  - search.results[3].to_json : dumps JSON of one search result
133
125
  - search.results[3].to_yaml : dumps YAML of one search result
134
126
 
135
127
  ## Installation
136
128
 
137
- jp@populuxe:~/code/ruby$ gem install gemcutter
138
- jp@populuxe:~/code/ruby$ gem tumble
139
- jp@populuxe:~/code/ruby$ gem install bossman
129
+ jp@populuxe:~/code/ruby$ gem install gemcutter
130
+ jp@populuxe:~/code/ruby$ gem tumble
131
+ jp@populuxe:~/code/ruby$ gem install bossman
140
132
 
141
133
  ## Requirements
142
134
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bossman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Pignata