Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'rubygems'
gem 'httparty', '= 0.4.3'
require 'httparty'
require 'tinder'
require 'feedzirra'
require 'nokogiri'
current_woot = nil
woot_url = 'http://woot.com/Blog/Feed.ashx'
subdomain = 'your_subdomain'
token = 'your_token_goes_here'
room_name = 'your_room'
post_images = false
post_to_campfire = true
campfire = Tinder::Campfire.new subdomain, :token => token
room = campfire.find_room_by_name room_name
while true
feed = Feedzirra::Feed.fetch_and_parse(woot_url)
woot = feed.entries.shift
while woot.categories.first != 'Woot'
woot = feed.entries.shift
end
if woot && current_woot != woot.url
html_doc = Nokogiri::HTML(woot.summary)
image = html_doc.at_css("img.thumbnail")
image_url = image['src'] if image
new_woot = "WootBot: #{woot.title} - #{woot.url}"
if post_to_campfire
room.speak new_woot
room.speak image_url if image_url && post_images
end
puts new_woot
puts image_url
current_woot = woot.url
end
sleep 30
end
@stve

This comment has been minimized.

Copy link
Owner Author

@stve stve commented Sep 21, 2010

consider it done! also filtered out regular blog posts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment