|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 ![]() |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
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 Last edited by Fletch1373 : 04-03-2010 at 22:44. |
|
#5
|
|||
|
|||
|
Re: API for FMS twitter feed
I think so, but it was trivial to parse the RSS, the real benefit of my API is parsing of the special format of their posts into usable data.
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. |
|
#6
|
||||
|
||||
|
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
|
|
#7
|
|||
|
|||
|
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. |
|
#8
|
||||
|
||||
|
Re: API for FMS twitter feed
Quote:
also, just out of curiosity, what do you need shell_exec for? |
|
#9
|
|||
|
|||
|
Re: API for FMS twitter feed
Quote:
|
|
#10
|
|||
|
|||
|
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. |
|
#11
|
||||
|
||||
|
Re: API for FMS twitter feed
interesting... you didn't feel like using PHP's built-in file system functions?
|
|
#12
|
||||
|
||||
|
*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? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Twitter Hash Tags for the Regionals | Justin | Regional Competitions | 13 | 05-03-2011 16:28 |
| Twitter for FRC | dk5sm5luigi | General Forum | 0 | 09-01-2010 08:02 |
| HOT ITEM: Qualifications Ranking program needed for FMS Lite | Andy Baker | General Forum | 2 | 17-10-2009 12:54 |
| Strange data in FMS Twitter feed | rsisk | Technical Discussion | 1 | 15-05-2009 09:53 |
| New Vex API for MCC18: LibVexBot | outpaddling | Programming | 2 | 22-12-2008 09:32 |