User http://code.google.com/p/phirehose/ as deamon. No cron job needed.
On Sun, Apr 3, 2011 at 2:05 AM, Digga <digga...@gmail.com> wrote: > How should I set up a cron job for twitter stream? I have a php file > that consumes and adds data to database ... > > f(! ($line = stream_get_line($instream, 20000, "\n"))) { > > What would be the best way to put that on a cron job, will this go > infinite if I put it on a schedule, or do I need to run the script > every half hour or something? > > > while(! feof($instream)) { > if(! ($line = stream_get_line($instream, 20000, > "\n"))) { > continue; > }else{ > $tweet = json_decode($line); > SaveData($tweet); > > } > > this how I consume the tweet, and save it. How can I do this on a > schedule? right now I run it in the browser, do I set this script to > go off every hour or so? or just let it run in the background? > > Please let me know. > > Sam. > > -- > Twitter developer documentation and resources: http://dev.twitter.com/doc > API updates via Twitter: http://twitter.com/twitterapi > Issues/Enhancements Tracker: > http://code.google.com/p/twitter-api/issues/list > Change your membership to this group: > http://groups.google.com/group/twitter-development-talk > -- 氣 -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk