Last active
          December 31, 2019 06:30 
        
      - 
      
 - 
        
Save pocke/6f833d431f419eb09bdd6beb0b5ee637 to your computer and use it in GitHub Desktop.  
    Print repositories created this year
  
        
  
    
      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 characters
    
  
  
    
  | require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'octokit' | |
| end | |
| name = ARGV[0] || `git config --get github.user`.chomp | |
| year = ARGV[1] || Time.now.year | |
| raise "ruby this-year-repos.rb USERNAME [YEAR]" if !name || name.empty? | |
| c = Octokit::Client.new.tap{ |c| | |
| c.per_page = 100 | |
| c.auto_paginate = true | |
| } | |
| puts c.search_repos("user:#{name} created:#{year}-01-01..#{year}-12-31").items.sort_by(&:created_at).map{|r|"https://github.com/#{r.full_name}"} | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment