lib/caboodle/kits/twitter/twitter.rb in caboodle-0.2.22 vs lib/caboodle/kits/twitter/twitter.rb in caboodle-0.2.23
- old
+ new
@@ -8,12 +8,16 @@
required [:twitter_username]
menu "Twitter"
configure do
- if Site.logo_url.to_s.blank? && !Site.twitter_username.to_s.blank?
- xml = Nokogiri::XML(open("http://twitter.com/users/#{Site.twitter_username}.xml").read)
- Site.logo_url = xml.css("profile_image_url").children.first.to_s
+ begin
+ if Site.logo_url.to_s.blank? && !Site.twitter_username.to_s.blank?
+ xml = Nokogiri::XML(open("http://twitter.com/users/#{Site.twitter_username}.xml").read)
+ Site.logo_url = xml.css("profile_image_url").children.first.to_s
+ end
+ rescue Exception=>e
+ Caboodle::Errors << Hashie::Mash.new({:title=>"Problem communicating with Twitter at startup", :reason=>e.backtrace})
end
end
credit "http://twitter.com/#{twitter_username}", "Follow @#{twitter_username} on Twitter"
\ No newline at end of file