batchblue (owner)

Forks

Revisions

gist: 55293 Download_button fork
public
Public Clone URL: git://gist.github.com/55293.git
Embed All Files: show embed
ri nexus twits #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'rubygems'
require 'open-uri'
require 'hpricot'
 
doc = open("http://rinexus.com/blog/2009/01/rhode-island-twitter-sound") { |f| Hpricot(f) }
 
twits = []
 
(doc/'.content/p').each do |p|
  p.inner_html.each do |line|
    matches = line.scan(/@(\w+)/m)
    twits.concat(matches) unless matches.empty?
  end
end
 
twits.flatten!
twits.uniq!
      
twits.each do |twit|
  puts twit
end