Created
November 29, 2012 11:09
-
-
Save mathfur/4168258 to your computer and use it in GitHub Desktop.
githubのissuesに登録したタイトルのみ取得する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "nokogiri" | |
require "open-uri" | |
ISSUES_URL = "https://github.com/:user/:repo/issues?state=:state" | |
def get_issues(user, repo, state='open') | |
url = ISSUES_URL.gsub(/:user\b/, user).gsub(/:repo\b/, repo).gsub(/:state\b/, state) | |
nokogiri = Nokogiri::HTML.parse(open(url)) | |
nokogiri.css('.issues table tr td a.js-navigation-open').map(&:text) | |
end | |
p get_issues('mathfur', 'word_manager', 'open') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment