Skip to content

Instantly share code, notes, and snippets.

@ramtiga
Created July 17, 2012 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramtiga/3127565 to your computer and use it in GitHub Desktop.
Save ramtiga/3127565 to your computer and use it in GitHub Desktop.
nogorigi test
# coding: utf-8
require 'nokogiri'
require 'open-uri'
require 'pp'
module GithubRuby
BASE_URL = "https://github.com/languages/Ruby"
def self.get
res = Nokogiri::HTML(open(BASE_URL))
res.css('div[class="container"] div[class="left row"]').each do |html|
pp html.css('h3').text
html.css('li').each do |li|
user = li.css('a[href]').text
repo = li.css('a[class="repo"]').text
user.sub!(repo, "")
pp user + " / " + repo
end
break
end
end
end
GithubRuby.get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment