Module: Webstalker

Defined in:
lib/webstalker.rb,
lib/webstalker/base.rb,
lib/webstalker/ohloh.rb,
lib/webstalker/flickr.rb,
lib/webstalker/github.rb,
lib/webstalker/reddit.rb,
lib/webstalker/twitter.rb,
lib/webstalker/youtube.rb

Defined Under Namespace

Classes: Base, Flickr, Github, Ohloh, Reddit, Twitter, Youtube

Class Method Summary collapse

Class Method Details

.service_for(net, username, opts = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/webstalker.rb', line 25

def self.service_for(net, username, opts = {})
  case net.to_s
  when "youtube"
    Webstalker::Youtube.new(username, opts)
  when "github"
    Webstalker::Github.new(username, opts)
  when "flickr"
    Webstalker::Flickr.new(username, opts)
  when "twitter"
    Webstalker::Twitter.new(username, opts)
  when "ohloh"
    Webstalker::Ohloh.new(username, opts)
  when "reddit"
    Webstalker::Reddit.new(username, opts)
  else
    raise ArgumentError, "unknown service: #{net}"
  end
end

.tags_for(net, username, opts = {}) ⇒ Object



20
21
22
23
# File 'lib/webstalker.rb', line 20

def self.tags_for(net, username, opts = {})
  service = self.service_for(net, username, opts)
  service ? service.tags : []
end