remaining tickets count from Eventbrite, without API
I've been helping out with an event, where for main event site we used shared GitHub repo with GRAV CMS, which is fantastic by the way. On the server where site is hosted, a script watches for updates to master and pulls latest, when available. It's pretty convenient and allows to simply wait a bit before changes submitted to master become go live, without having to do a simple, but distracting release. Sort of a
Recently, I've noticed that one of the event organizers manually updates ticket count on the site every so often.. sort of a drag. Since our event signup is hosted on Eventbrite, I've looked into API method of accessing the ticket counts and while it's possible, it didn't seem like there is a way of using anonymous OAUTH token to get it and I'd rather not expose a private secret by adding it to a JavaScript request in the site code.
Since Eventbrite does not send free-for-all CORS headers, but instead sends x-content-type-options:nosniff
with the response (defeating the jsonp trick) , I could not doing a straight-forward jQuery .get/.ajax
. Luckily, there are few free proxies available and it even wouldn't be too difficult to roll my own. Of which I ended up using crossorigin.me as easiest to work with.
Simple enough and no need to update ticket count manually anymore..