Class: Webstalker::Github

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

def tags
  url = "http://github.com/api/v2/json/repos/show/#{username}"

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

  tags = Set.new
  data["repositories"].each do |repo|
    langs = JSON.parse(open("http://github.com/api/v2/json/repos/show/#{repo["owner"]}/#{repo["name"]}/languages").read)
    langs["languages"].each do |k,v|
      tags << k.downcase
    end
  end

  tags << "developer"

  tags
end