Class: Webstalker::Twitter

Inherits:
Base
  • Object
show all
Defined in:
lib/webstalker/twitter.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #username

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Webstalker::Base

Instance Method Details

#tagsObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/webstalker/twitter.rb', line 3

def tags
  url = "http://api.twitter.com/1/favorites/#{username}.json"

  doc = JSON.parse(open(url).read)

  r = Set.new
  doc.each do |t|
    t["text"].split(/\s+/).each do |w|
      if w=~/^#(.+)/
        r << $1
      end
    end
  end

  r
end