Hey Guys,

I'm trying to stream in any tweets related to my keyword but for some
reason they won't go into the my_sql database any thoughts? The other
day it suddenly started working....now its not working again....i dont
get it.

        $fp = fopen("http://"; . $username . ":" . $password .
"@stream.twitter.com/1/statuses/filter.json?track=" . $keyword , 'r');

        while($data = fgets($fp))
        {
                $tweet = json_decode($data, true);

                $user = $tweet['user']['screen_name'];
                $text = $tweet['text'];

                $sql = "INSERT INTO dbname (user,tweet) 
VALUES('$user','$tweet')";
                mysql_query($sql);
        }

        fclose($fp);

-- 
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

Reply via email to