proxb / PoshCharts

Module designed to make working with .Net Chart Controls easier
MIT License
32 stars 13 forks source link

Test cases to use GitHubArchive.com #7

Open jzabroski opened 6 years ago

jzabroski commented 6 years ago

http://www.githubarchive.org/

GitHubArchive stores all the public events from the GitHub timeline and exposes them for processing. The events contain info about the repositories, so you should be able to pull the data out of there to fit your use-case.

I am inspired by Sourcer.IO, but I do not trust them with my login details, so I thought it would be cool if some test cases also served as an interactive tutorial.

jzabroski commented 6 years ago
 Invoke-WebRequest -Uri "http://data.githubarchive.org/2015-01-01-12.json.gz" -OutFile githubarchive2012-01-01-12.json.gz"
 Install-Module PS7Zip -Repository PSGallery -Scope CurrentUser
 Set-ExecutionPolicy RemoteSigned -CurrentUser
 Import-Module PS7Zip
 Expand-7Zip .\githubarchive2012-01-01-12.json.gz
 $data = Get-Content .\githubarchive2012-01-01-12.json | ConvertFrom-Json
 Import-Module .\PoshCharts.psm1
 $data | group type | Out-ColumnChart -XField Name -YField Count -Title "# of Events"

This might seem a bit ridiculous, but it's also useful in that it points out gaps in the charting. For example, in this situation, I realized Out-ColumnChart is terrible at auto-formatting axis data of type string.