lancecarlson-yahoo-se 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -10,23 +10,26 @@ gem install yahoo-se
10
10
 
11
11
  == Usage
12
12
 
13
- Yahoo::SE.application_id = "YOUR_YAHOO_APPLICATION_ID"
14
-
15
- backlinks = Yahoo::SE.inlinks("http://rubyskills.com", :results => 100)
16
-
17
- backlinks.results
18
-
19
- page_data = Yahoo::SE.pages("http://rubyskills.com", :results => 100)
20
-
21
- page_data.results
22
-
23
- ping = Yahoo::SE.ping("http://rubyskills.com")
24
-
25
- ping.response
26
-
27
- update_notification = Yahoo::SE.update_notification("http://rubyskills.com")
28
-
29
- update_notification.response
13
+ Yahoo::SE.application_id = "YOUR_YAHOO_APPLICATION_ID"
14
+
15
+ # Inlink Service
16
+ backlinks = Yahoo::SE.inlinks("http://rubyskills.com", :results => 100)
17
+ backlinks.results
18
+ backlinks.next
19
+ backlinks.results
20
+
21
+ # Page Service
22
+ page_data = Yahoo::SE.pages("http://rubyskills.com", :results => 100)
23
+ page_data.results
24
+ page_data.next.results
25
+
26
+ # Ping Service
27
+ ping = Yahoo::SE.ping("http://rubyskills.com")
28
+ ping.response
29
+
30
+ # Update Notification Service
31
+ update_notification = Yahoo::SE.update_notification("http://rubyskills.com")
32
+ update_notification.response
30
33
 
31
34
  See Yahoo::SE for more info
32
35
 
data/lib/yahoo-se.rb CHANGED
@@ -12,6 +12,6 @@ module Yahoo
12
12
  end
13
13
 
14
14
 
15
- %w(inlinks pages request response result version ping update_notification).each do |file|
15
+ %w(exceptions inlinks pages request response result version ping update_notification).each do |file|
16
16
  require File.join(File.dirname(__FILE__), "yahoo-se", file)
17
17
  end
@@ -28,6 +28,7 @@ module Yahoo
28
28
 
29
29
  # Displays the results for inlinks data
30
30
  def results
31
+ raise ApplicationIDNotSet if Yahoo::SE.application_id.nil?
31
32
  @request = Yahoo::SE::Request.new(Yahoo::SE::Inlinks::SERVICE_PATH, @options)
32
33
  @request.results
33
34
  end
@@ -28,6 +28,7 @@ module Yahoo
28
28
 
29
29
  # Displays the results for pages data
30
30
  def results
31
+ raise ApplicationIDNotSet if Yahoo::SE.application_id.nil?
31
32
  @request = Yahoo::SE::Request.new(Yahoo::SE::Pages::SERVICE_PATH, @options)
32
33
  @request.results
33
34
  end
@@ -22,6 +22,7 @@ module Yahoo
22
22
  end
23
23
 
24
24
  def response
25
+ raise ApplicationIDNotSet if Yahoo::SE.application_id.nil?
25
26
  Yahoo::SE::Request.new(Yahoo::SE::UpdateNotification::SERVICE_PATH, @options).response
26
27
  end
27
28
  end
@@ -1,5 +1,5 @@
1
1
  module Yahoo
2
2
  module SE
3
- VERSION = "1.0.1" unless defined?(Yahoo::SE::VERSION)
3
+ VERSION = "1.0.2" unless defined?(Yahoo::SE::VERSION)
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ describe Yahoo::SE::UpdateNotification do
11
11
  end
12
12
 
13
13
  it "should return a successful JSON message" do
14
+ Yahoo::SE.application_id = "123"
14
15
  Yahoo::SE::Request.should_receive(:new).with("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification", {:url=>"erbmicha.com"}).and_return(@request)
15
16
  Yahoo::SE.update_notification("erbmicha.com")
16
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lancecarlson-yahoo-se
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lance Carlson