Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.