3 ms·
You could also poll the Github API direclty on the client side via Javascript/jQuery (without giving the client an access token obviously) to display the status
by ThePhysicist 11y ago
You could also poll the Github API direclty on the client side via Javascript/jQuery (without giving the client an access token obviously) to display the status information, like that you could simply update issues on a public Github repo and the information would change accordingly on the site. With proper E-Tag checking, Github won't even count repeated API queries against the rate limit, which means that you could have the client automatically update the information in the frontend every few seconds.
With Gitboard I use the Github API in this way to display issues in a Kanban board, which works really nicely: https://adewes.github.io/gitboard https://adewes.github.io/gitboard
- vmorgulis 11y agoVery cool idea! > ... With proper E-Tag checking, Github won't even count repeated API queries against the rate limit ... Does this behavior rely only on the browser side? Did you add something in javascript?
- ThePhysicist 11y agoYou need to pass the ETag header in the Ajax request, though jQuery might do this automatically (have a look at the utils.js in Gitboard: http://github.com/adewes/gitboard http://github.com/adewes/gitboard). As long as you set it and the data is unchanged you can poll for it as often as you want, which us perfect to watch for changes.
- mwpmaybe 11y agojQuery doesn't automatically attach the ETag, but the browser does.
- vmorgulis 11y agoSo etags should work with JSONP call... I found that: http://fitzgen.github.io/github-api/ http://fitzgen.github.io/github-api/
- ThePhysicist 11y agoI think you don't even need JSONP, just make sure to set the cross-domain headers and it should work.
- vmorgulis 11y agoThank you a lot! I missed that part: https://developer.github.com/v3/#conditional-requests https://developer.github.com/v3/#conditional-requests "Also note: making a conditional request and receiving a 304 response does not count against your Rate Limit, so we encourage you to use it whenever possible."