![]() |
API for FMS twitter feed
I wrote this last night, and after seeing that it works today, figured I might share it.
This is a PHP API to grab the #FRCFMS Twitter feed, and parse it's data in an easy-to-access way. The file is http://servb.ath.cx:3445/~luke/1024/frcfms/frcfms.php, get the source at http://servb.ath.cx:3445/~luke/1024/...ile=frcfms.php Another file of interest is index.php, a sample use of this. adding ?team=XXXX will filter to only show a certain team. So, for example, I can see all of our team's matches with http://servb.ath.cx:3445/~luke/1024/....php?team=1024 load_frcfms() returns an array of objects that have the
I'll probably write up some real documentation eventually, but hopefully some of you find this useful. |
Re: API for FMS twitter feed
Doesn't twitter have it's own API?
The only reason I say that is because I've done a lot of xlet programming (java applet for tru2way cable boxes), and one of the things I wrote was a twitter client. I haven't messed with it since... last summer... and I don't intend to anymore. Actually, come to think of it, I might tweak my program to do just that, so I have something to distract me at work these next few weeks :p |
Re: API for FMS twitter feed
I didn't even think about using the Twitter feed like that, pretty sweet.. thanks for the idea!
by the way, your frcfms_event() function would probably be better off as an associative array ;) slightly more efficient, slightly neater. |
Re: API for FMS twitter feed
I have also attempted this... mine isn't currently set up as a distributable API, but more for personal/team use... however I do have it live on the web for all to use
the URL is http://fletch809.mine.nu/FRCFMS I'm wide open to suggestions for it, and already have a list of features to add I would also like to add that mine is stored in a mySQL database for future use as twitter's API only allows you to read so many tweets at a time |
Re: API for FMS twitter feed
Quote:
Quote:
I also think that anyone using mine should set up a cron task to download/cache a copy of the RSS feed every minute or something, as sometimes it is unresponsive, which will throw a PHP error if it can't open. |
Re: API for FMS twitter feed
mine uses a cron task to run a python script every 30 minutes to parse the recent tweets(since the last recorded one), and is reading the XML version of the twitter API
|
Re: API for FMS twitter feed
I've updated mine to use a cache.
Check out `table.php' in http://servb.ath.cx:3445/~luke/1024/frcfms/cached/ The cache is out of-date/missing entries, because I was testing it on my computer, which didn't have constant internet, and now shell_exec is disabled on the server for security purposes, and it is needed to update the cache. Anyway, if it were enabled, it would update every minute on the minute. |
Re: API for FMS twitter feed
Quote:
also, just out of curiosity, what do you need shell_exec for? |
Re: API for FMS twitter feed
Quote:
|
Re: API for FMS twitter feed
Quote:
PHP Code:
Quote:
2) it would take less HDD space, and not have to check for updates every minute, because it is using HTTP to get google's cache. Though, I didn't do this, I did write my own cache. |
Re: API for FMS twitter feed
Quote:
|
Re: API for FMS twitter feed
*Bump*
I'm from a fairly inept team, and personally I have little idea what this is about (I had to Google API). I'm trying to use this code to turn the Twitter feeds into a graphic output which we can have on a computer monitor in our pit. Again, I have absolutely no idea what I'm doing. How does one implement these programs? |
| All times are GMT -5. The time now is 15:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi