jimbojsb / github-repo-events
A standalone client for parsing the Github Repo Events API
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/jimbojsb/github-repo-events
Requires
- php: >= 5.5
- resty/resty: ^0.6.0
This package is auto-updated.
Last update: 2025-09-18 07:12:47 UTC
README
This library will allow you to poll the Github events API rather than using a web hook.
Usage
Basic usage on a public repo
$eventsStream = new GithubRepoEvents\RepsitoryEventStream("user/repo"); foreach ($eventsStream as $event) { // do stuff with events }
Add an API key for increased quota or access to private repos
$eventsStream = new GithubRepoEvents\RepsitoryEventStream("user/repo", "githubApiKey"); foreach ($eventsStream as $event) { // do stuff with events }
Use ETags to avoid quota hits
// costs from quota $eventsStream = new GithubRepoEvents\RepsitoryEventStream("user/repo", "githubApiKey"); foreach ($eventsStream as $event) { // do stuff with events } $etag = $eventStream->getEtag(); // does not cost from quota, assuming the stream has no new events $eventsStream = new GithubRepoEvents\RepsitoryEventStream("user/repo", "githubApiKey"); $eventStream->setEtag($etag); foreach ($eventsStream as $event) { // do stuff with events }