Created
April 18, 2019 11:31
-
-
Save detunized/445c17223817c4a01dc0ea62a1aa881a to your computer and use it in GitHub Desktop.
Fetch GitHub activity from your profile page
This file contains 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 "open-uri" | |
def github_activity username | |
open("https://github.com/#{username}") { |io| io.read } | |
.scan(/fill="#(.{6})" data-count="(\d+)"/) | |
.map { |i| {color: i[0], value: i[1].to_i} } | |
end | |
p github_activity "your-username" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment