jimbojsb / github-repo-events
A standalone client for parsing the Github Repo Events API
v0.1.2
2017-02-17 17:15 UTC
Requires
- php: >= 5.5
- resty/resty: ^0.6.0
This package is auto-updated.
Last update: 2024-10-18 05:22:11 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 }