Class: Webstalker::Reddit

Inherits:
Base
  • Object
show all
Defined in:
lib/webstalker/reddit.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
# File 'lib/webstalker/reddit.rb', line 3

def tags
  url = "http://reddit.com/user/#{username}.json"

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

  r = Set.new
  doc['data']['children'].each do |t|
    r << t['data']['subreddit']
  end

  r
end