Class: Webstalker::Ohloh

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

def tags
  url = "http://www.ohloh.net/accounts/#{username}"

  doc = Nokogiri::HTML(open(url))

  r=Set.new
  doc.css("#page a.position").each do |link|
    r<< link["href"].match(/\/p\/([^\/]+)/)[1].downcase
  end

  doc.css("#page th.lang.small a").each do |link|
    r<< link.text.strip.downcase
  end

  r << "developer"

  r
end