Created
July 14, 2010 09:13
-
-
Save matiaskorhonen/475212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "tinder" | |
require "ap" | |
# Edit to match your campfire details | |
campfire = Tinder::Campfire.new "YOUR_SUBDOMAIN", :token => "YOUR_CAMPFIRE_API_TOKEN" | |
room = campfire.find_room_by_name "YOUR_CAMPFIRE_ROOM" | |
messages = [] | |
(0...7).each do |i| | |
messages.push(*room.transcript(Date.today - i.days)) | |
end | |
links = messages.map do |m| | |
# Pick out the messages with links (and exclude Git commit messages) | |
if !m[:message].nil? && !m[:message].match(/^\[\w+\/\w+\]/i) && m[:message].match(/(http|https):\/\/.+\s*/i) | |
m[:message] | |
end | |
end | |
links.compact! | |
links.uniq! | |
ap links |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment