Class: Google::Blogsearch::Ping
- Inherits:
-
Object
- Object
- Google::Blogsearch::Ping
- Defined in:
- lib/google-blogsearch-pings.rb
Instance Attribute Summary collapse
-
#feed_url ⇒ Object
Returns the value of attribute feed_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#site_url ⇒ Object
Returns the value of attribute site_url.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#update_url ⇒ Object
Returns the value of attribute update_url.
Instance Method Summary collapse
-
#initialize(name, feed_url, options = {}) ⇒ Ping
constructor
A new instance of Ping.
- #ping! ⇒ Object
- #tags_param ⇒ Object
Constructor Details
#initialize(name, feed_url, options = {}) ⇒ Ping
Returns a new instance of Ping.
8 9 10 11 12 13 |
# File 'lib/google-blogsearch-pings.rb', line 8 def initialize(name, feed_url, = {}) @name, @feed_url = name, feed_url @site_url = .delete(:site) || infer_url(feed_url) @update_url = .delete(:update) || .delete(:updated) || infer_url(feed_url) self. = .delete(:tags) || [] end |
Instance Attribute Details
#feed_url ⇒ Object
Returns the value of attribute feed_url.
6 7 8 |
# File 'lib/google-blogsearch-pings.rb', line 6 def feed_url @feed_url end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/google-blogsearch-pings.rb', line 6 def name @name end |
#site_url ⇒ Object
Returns the value of attribute site_url.
6 7 8 |
# File 'lib/google-blogsearch-pings.rb', line 6 def site_url @site_url end |
#tags ⇒ Object
Returns the value of attribute tags.
6 7 8 |
# File 'lib/google-blogsearch-pings.rb', line 6 def @tags end |
#update_url ⇒ Object
Returns the value of attribute update_url.
6 7 8 |
# File 'lib/google-blogsearch-pings.rb', line 6 def update_url @update_url end |
Instance Method Details
#ping! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/google-blogsearch-pings.rb', line 15 def ping! server = XMLRPC::Client.new2("http://blogsearch.google.com/ping/RPC2") if .length == 0 ok, param = server.call2("weblogUpdates.extendedPing", name, site_url, update_url, feed_url) else ok, param = server.call2("weblogUpdates.extendedPing", name, site_url, update_url, feed_url, ) end if ok error, = param['flerror'], param['message'] raise if error else raise "#{param.faultString} (#{param.faultCode})" end end |
#tags_param ⇒ Object
32 33 34 |
# File 'lib/google-blogsearch-pings.rb', line 32 def .join("|") end |