ba-webby-pingback 1.0.0.1 → 1.0.1

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.
@@ -44,10 +44,18 @@ module Pingback
44
44
  # Tries to find a pingback url from a given URL. If found ping it.
45
45
  def start(verbose = false)
46
46
  @urls.each do |url|
47
+ begin
48
+ print "#{url} => "
47
49
  pingback_url = find_pingback_url(url)
48
50
  if pingback_url
49
51
  send_ping(pingback_url, url)
52
+ else
53
+ puts 'Nothing to ping'
50
54
  end
55
+ rescue Exception => e
56
+ STDERR.puts e.message
57
+ next
58
+ end
51
59
  end
52
60
  end
53
61
 
@@ -81,10 +89,11 @@ module Pingback
81
89
  uri = URI.parse(xmlrpc_uri)
82
90
  server = XMLRPC::Client.new(uri.host, uri.path, uri.port)
83
91
  begin
92
+ print "#{uri.host}#{uri.path}: "
84
93
  result = server.call('pingback.ping',
85
94
  @source_url,
86
95
  target)
87
- puts "#{uri.host}#{uri.path}: #{result['message']}"
96
+ puts "#{result['message']}"
88
97
  rescue XMLRPC::FaultException => e
89
98
  puts "#{uri.host}#{uri.path}: Error -- #{e.message}"
90
99
  end
data/tasks/pingback.rake CHANGED
@@ -10,7 +10,7 @@ namespace :pingback do
10
10
  db.each do |page|
11
11
  doc = Hpricot(File.read(Webby.site.output_dir + page.url))
12
12
  urls = (doc/'/html/body//a[@href]').inject([]) do |memo, a|
13
- if a['href'] == ("#{Webby.site.base}/") or a['href'].match(/(disqus)|(webby.rubyforge.org)/)
13
+ if a['href'] == ("#{Webby.site.base}/") or a['href'].match(/(disqus.com)|(webby.rubyforge.org)/)
14
14
  memo
15
15
  else
16
16
  memo << a['href']
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "webby-pingback"
4
- s.version = "1.0.0.1"
4
+ s.version = "1.0.1"
5
5
  s.date = Time.now.strftime('%Y-%m-%d')
6
6
  s.description = "Using Webby and some custom meta-data tags enable pingbacks to blogs and pages"
7
7
  s.authors = ["Björn Andersson"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ba-webby-pingback
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.1
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Bj\xC3\xB6rn Andersson"