Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unwatch GitHub repos

Janos Gyerik
September 14, 2016

Unwatch GitHub repos

When you need to perform an operation on a large number of GitHub repositories, their REST API and some command line magic comes in handy. This short talk will demonstrate a technique to watch and un-watch GitHub repositories using ad-hoc scripting. The example should give a good idea how to perform other bulk operations too.

Janos Gyerik

September 14, 2016
Tweet

More Decks by Janos Gyerik

Other Decks in Programming

Transcript

  1. WATCH OR UN-WATCH
    GITHUB REPOSITORIES USING
    GITHUB API + CURL + JQ + BASH
    https://speakerdeck.com/janosgyerik/unwatch-github-repos

    View full-size slide

  2. So I have this setting on GitHub…

    View full-size slide

  3. 2 days after joining SonarSource Org…

    View full-size slide

  4. How to un-watch many?

    View full-size slide

  5. How to un-watch many?
    click click click …

    View full-size slide

  6. click click click …
    click click click …
    click click click …
    click click click …
    click click click …
    click click click …
    click click cli
    click click cli
    click click cli
    click click cli
    click click cli
    click click cli
    click click click …
    click click click …
    click click click …
    click click click …
    click click click …
    click click click …
    How patient are you?

    View full-size slide

  7. Search on GitHub API for “watching”
    (or, well, how about just “w”…)

    View full-size slide

  8. https://developer.github.com/v3/activity/watching/#get-a-repository-subscription

    View full-size slide

  9. First attempt:

    View full-size slide

  10. Could be important?

    View full-size slide

  11. Second attempt…

    View full-size slide

  12. Third attempt?

    View full-size slide

  13. Un-watch one

    View full-size slide

  14. Un-watch one

    View full-size slide

  15. List ‘em all

    View full-size slide

  16. Un-watch ‘em all

    View full-size slide