Github in irc announcer: Difference between revisions

From NURDspace
(Created page with "Poll every hour for new shit on github by our members: * e.g.: curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/users/folkertvanheusden/events * this...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 36: Line 36:
   },
   },
</nowiki>
</nowiki>
* https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps
* Apparently there's a python thing for accessing github meta data: https://github.com/PyGithub/PyGithub
----
* 2021-8-14 proof of concept: https://github.com/NURDspace/github-announcer

Latest revision as of 00:13, 14 August 2021

Poll every hour for new shit on github by our members:

  • this returns a list of events. each has an 'id'. keep track for each member the last id retrieved.
  • if an id is newer, push the url etc to irc

Rest sample output:

 {
    "id": "17380485057",
    "type": "CreateEvent",
    "actor": {
      "id": 85709915,
      "login": "folkertvanheusden",
      "display_login": "folkertvanheusden",
      "gravatar_id": "",
      "url": "https://api.github.com/users/folkertvanheusden",
      "avatar_url": "https://avatars.githubusercontent.com/u/85709915?"
    },
    "repo": {
      "id": 391194092,
      "name": "folkertvanheusden/rtpmidid",
      "url": "https://api.github.com/repos/folkertvanheusden/rtpmidid"
    },
    "payload": {
      "ref": "cmake",
      "ref_type": "branch",
      "master_branch": "master",
      "description": "RTP MIDI (AppleMIDI) daemon for Linux",
      "pusher_type": "user"
    },
    "public": true,
    "created_at": "2021-07-31T15:55:04Z"
  },