Giter VIP home page Giter VIP logo

starghaze's Introduction

stargaze

Save information about your GitHub starred repos into Google Sheets, Zinc, and SQLite!

Thanks to https://github.com/yks0000/starred-repo-toc for the inspiration!

GraphQL and Google Sheets auth notes at ./dev_notes.md

Install

scoop bucket add bbkane https://github.com/bbkane/scoop-bucket
scoop install bbkane/starghaze
  • Download Mac/Linux/Windows executable: GitHub releases
  • Go: go install go.bbkane.com/starghaze@latest
  • Build with goreleaser after cloning: goreleaser --snapshot --skip-publish --rm-dist

Download GitHub Stars

Download Star Info

GITHUB_TOKEN=my_github_token starghaze download \
    --include-readmes true \
    --output stars.jsonl

Google Sheets

Format Downloaded Stars as CSV

starghaze format \
    --format csv \
    --include-readmes false \
    --output stars.csv

Upload CSV to Google Sheets

GOOGLE_APPLICATION_CREDENTIALS=/path/to/keys.json starghaze gsheets upload \
    --csv-path stars.csv \
    --sheet-id 0 \
    --spreadsheet-id 15AXUtql31P62zxvEnqxNnb8ZcCWnBUYpROAsrtAhOV0 \
    --timeout 30s

Analyze Away!

Click here to see My GitHub Stars Google Sheet

star-count-over-time.png

Save Stars to Zinc

Format Downloaded Stars as Zinc

starghaze format \
    --include-readmes true \
    --format zinc \
    --output stars.zinc \
    --zinc-index-name starghaze

Upload to Zinc

Using default settings - See Zinc repo for more details.

curl http://localhost:4080/api/_bulk -i -u admin:Complexpass#123 --data-binary "@stars.zinc"

Search!

starghaze-zinc.png

SQLite

Format Downloaded Stars to SQLite (with full text search)

starghaze format \
    --format sqlite \
    --include-readmes true \
    --sqlite-dsn starghaze.db

Query!

For example, find the top 10 languages (as measured by number of repos) in the starred collection.

$ sqlite3 starghaze.db '
SELECT
    l.Name ,
    COUNT(lr.Language_id) as Repo_Count
FROM
    Language_Repo lr JOIN Language l ON lr.Language_id = l.id
GROUP BY Language_id
ORDER BY Repo_Count DESC
LIMIT 10
'
-- Loading resources from /Users/bbkane/.sqliterc
┌────────────┬────────────┐
│    Name    │ Repo_Count │
├────────────┼────────────┤
│ Shell      │ 939        │
│ JavaScript │ 617        │
│ HTML       │ 598        │
│ Python     │ 540        │
│ Makefile   │ 519        │
│ CSS        │ 432        │
│ Dockerfile │ 403        │
│ Go         │ 367        │
│ C          │ 305        │
│ C++        │ 230        │
└────────────┴────────────┘

starghaze's People

Contributors

bbkane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

starghaze's Issues

Create search engine

Embed a small webpage to FTS search the db more easily. Extra points for browsing by tag

Add User table

Make User a table and make starred_at an edge field. Then I can add multiple people's stas to the same db

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.