Created
March 15, 2015 09:46
-
-
Save SteveBenner/11808b089d97ccfd2c93 to your computer and use it in GitHub Desktop.
Revisions
-
SteveBenner created this gist
Mar 15, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ # The 'github_api' gem is implicility assumed to have been loaded at this point... # Configuration data is passed to Github::Client#new as a Hash whose keys are Symbols CONFIG_DATA = { user: 'github-username', login: '[email protected]', oauth_token: 'personal-access-token' # one of many valid authentication methods (see the gem docs for more) } # Data is returned from the API as a Github::ResponseWrapper object starred = Github.new(CONFIG_DATA).activity.starring.starred File.open('path-to-output-dir/starred.md', 'w') do |f| # By default, entries are dispensed 30-per-call. Thanks to helpers provided in Github::Paginate, the entire # result set can be collated into a single Array; just call 'auto_paginate' with 'true' as parameter. starred.auto_paginate(true).each do |r| f.puts "- [#{r['full_name']}](#{r['html_url']})" # Markdown links are easy to generate end end