lancecarlson-yahoo-se 0.0.3 → 1.0.0
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/LICENSE +1 -1
- data/README +8 -0
- data/Rakefile +3 -3
- data/lib/yahoo-se/ping.rb +12 -5
- data/lib/yahoo-se/update_notification.rb +29 -0
- data/lib/yahoo-se/version.rb +1 -1
- data/spec/yahoo-se/update_notification_spec.rb +17 -0
- metadata +5 -2
data/LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2008-2008
|
2
|
+
# Copyright (c) 2008-2008 Ruby Skills <info@rubyskills.com>
|
3
3
|
#
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
5
|
# this software and associated documentation files (the "Software"), to deal in the
|
data/README
CHANGED
@@ -20,6 +20,14 @@ page_data = Yahoo::SE.pages("http://rubyskills.com", :results => 100)
|
|
20
20
|
|
21
21
|
page_data.results
|
22
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
|
30
|
+
|
23
31
|
See Yahoo::SE for more info
|
24
32
|
|
25
33
|
see: http://developer.yahoo.com/search/siteexplorer for more details on the Yahoo API.
|
data/Rakefile
CHANGED
@@ -11,8 +11,8 @@ NAME = "yahoo-se"
|
|
11
11
|
AUTHOR = "Lance Carlson"
|
12
12
|
EMAIL = "info@rubyskills.com"
|
13
13
|
HOMEPAGE = "http://www.rubyskills.com"
|
14
|
-
SUMMARY = "Yahoo Site Explorer Gem"
|
15
|
-
DESCRIPTION = "Ruby gem for the Yahoo Site Explorer API"
|
14
|
+
SUMMARY = "Yahoo! Site Explorer Gem"
|
15
|
+
DESCRIPTION = "Ruby gem for the Yahoo! Site Explorer API"
|
16
16
|
|
17
17
|
dist_dirs = [ "lib", "spec" ]
|
18
18
|
|
@@ -42,7 +42,7 @@ end
|
|
42
42
|
|
43
43
|
Rake::RDocTask.new do |rdoc|
|
44
44
|
rdoc.rdoc_dir = 'doc'
|
45
|
-
rdoc.title = 'Yahoo Site Explorer'
|
45
|
+
rdoc.title = 'Yahoo! Site Explorer'
|
46
46
|
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
|
47
47
|
rdoc.options << '--charset' << 'utf-8'
|
48
48
|
rdoc.rdoc_files.include('README')
|
data/lib/yahoo-se/ping.rb
CHANGED
@@ -1,16 +1,23 @@
|
|
1
1
|
module Yahoo
|
2
2
|
module SE
|
3
|
-
|
4
|
-
|
3
|
+
# Allows you to notify Yahoo! of changes to your site. No appid required
|
4
|
+
#
|
5
|
+
# ping = Yahoo::SE.pages("http://rubyskills.com")
|
6
|
+
#
|
7
|
+
# ping.response
|
8
|
+
#
|
9
|
+
# sitemap: The URL of the page to be submitted, or the URL of a feed containing site data.
|
10
|
+
def self.ping(sitemap)
|
11
|
+
Yahoo::SE::Ping.new(sitemap)
|
5
12
|
end
|
6
13
|
|
7
14
|
class Ping
|
8
15
|
SERVICE_PATH = "#{Yahoo::SE::SERVICE_PATH}/ping"
|
9
16
|
|
10
|
-
def initialize(
|
11
|
-
@
|
17
|
+
def initialize(sitemap)
|
18
|
+
@sitemap = sitemap
|
12
19
|
@options = {}
|
13
|
-
@options[:sitemap] =
|
20
|
+
@options[:sitemap] = sitemap
|
14
21
|
response
|
15
22
|
end
|
16
23
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Yahoo
|
2
|
+
module SE
|
3
|
+
# The Update Notification service allows you to notify Yahoo! when your site changes. You may notify us about a single page, or a set of pages that need attention.
|
4
|
+
#
|
5
|
+
# update_notification = Yahoo::SE.update_notification("http://rubyskills.com")
|
6
|
+
#
|
7
|
+
# page_data.response
|
8
|
+
#
|
9
|
+
# url: The URL of the page to be submitted, or the URL of a feed containing site data.
|
10
|
+
def self.update_notification(url)
|
11
|
+
Yahoo::SE::UpdateNotification.new(url)
|
12
|
+
end
|
13
|
+
|
14
|
+
class UpdateNotification
|
15
|
+
SERVICE_PATH = "#{Yahoo::SE::SERVICE_PATH}/updateNotification"
|
16
|
+
|
17
|
+
def initialize(url)
|
18
|
+
@url = url
|
19
|
+
@options = {}
|
20
|
+
@options[:url] = url
|
21
|
+
response
|
22
|
+
end
|
23
|
+
|
24
|
+
def response
|
25
|
+
Yahoo::SE::Request.new(Yahoo::SE::UpdateNotification::SERVICE_PATH, @options).response
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/yahoo-se/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "..", "spec_helper")
|
2
|
+
|
3
|
+
describe Yahoo::SE::UpdateNotification do
|
4
|
+
before do
|
5
|
+
@response = mock(Yahoo::SE::Response)
|
6
|
+
@request = mock(Yahoo::SE::Request, :response => @response)
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should have the service path for the updateNotification service" do
|
10
|
+
Yahoo::SE::UpdateNotification::SERVICE_PATH.should == "http://search.yahooapis.com/SiteExplorerService/V1/updateNotification"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return a successful JSON message" do
|
14
|
+
Yahoo::SE::Request.should_receive(:new).with("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification", {:url=>"erbmicha.com"}).and_return(@request)
|
15
|
+
Yahoo::SE.update_notification("erbmicha.com")
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lancecarlson-yahoo-se
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lance Carlson
|
8
|
+
- Michael Erb
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -32,6 +33,7 @@ files:
|
|
32
33
|
- lib/yahoo-se/request.rb
|
33
34
|
- lib/yahoo-se/response.rb
|
34
35
|
- lib/yahoo-se/result.rb
|
36
|
+
- lib/yahoo-se/update_notification.rb
|
35
37
|
- lib/yahoo-se/version.rb
|
36
38
|
- spec/fixtures/erbmicha.com_backlinks.json
|
37
39
|
- spec/fixtures/erbmicha.com_pages.json
|
@@ -43,6 +45,7 @@ files:
|
|
43
45
|
- spec/yahoo-se/request_spec.rb
|
44
46
|
- spec/yahoo-se/response_spec.rb
|
45
47
|
- spec/yahoo-se/result_spec.rb
|
48
|
+
- spec/yahoo-se/update_notification_spec.rb
|
46
49
|
- spec/yahoo-se_spec.rb
|
47
50
|
has_rdoc: true
|
48
51
|
homepage: http://www.rubyskills.com
|
@@ -69,6 +72,6 @@ rubyforge_project:
|
|
69
72
|
rubygems_version: 1.2.0
|
70
73
|
signing_key:
|
71
74
|
specification_version: 2
|
72
|
-
summary: Ruby gem for
|
75
|
+
summary: Ruby gem for Yahoo! Site Explorer
|
73
76
|
test_files: []
|
74
77
|
|