Skip to content

Instantly share code, notes, and snippets.

@mathfur
Created November 29, 2012 11:09
Show Gist options
  • Save mathfur/4168258 to your computer and use it in GitHub Desktop.
Save mathfur/4168258 to your computer and use it in GitHub Desktop.
githubのissuesに登録したタイトルのみ取得する
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