Skip to content

Instantly share code, notes, and snippets.

@sharnie
Created September 4, 2015 02:00
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 sharnie/16704f34e806c6fe4c33 to your computer and use it in GitHub Desktop.
Save sharnie/16704f34e806c6fe4c33 to your computer and use it in GitHub Desktop.
require 'nokogiri'
require 'open-uri'
usernames = [
'brianknight10',
'annekagoss',
'bethannezink',
'DanFerrer',
'antropova',
'himedlooff',
'sharnie',
'CarpeDN',
'aromayne',
'tadasv',
'rvangundy',
'samueldowens'
]
usernames.each do |username|
begin
doc = Nokogiri::HTML(open("https://www.github.com/#{username}"))
color = doc.css("#contributions-calendar [data-date=\"#{Date.today.prev_day}\"]").attr("fill")
committed = color.to_s == "#eeeeee" ? "No commits" : "Committed"
puts "#{username}: #{committed}"
rescue
puts "Invalid username: #{username}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment