I had a previous post on this topic but this is a different way of doing it so ...
I'm trying to get a 'stream' of statuses back from twitters streamed tweets resources using a filter http://dev.twitter.com/doc/post/statuses/filter
These are the methods from the streaming API http://dev.twitter.com/pages/streaming_api_methods from those methods I essentially created this: (keep in mind that this is my first time using curl or the twitter api so I'm possibly way off) Im fairly certain my request is at least working because twitter is returning "No filter parameters found. Expect at least one parameter: follow track locations annotations " keeping in mind I've tried many different variations of creating the usernames array
Code:$url="http://stream.twitter.com/1/statuses/filter.json"; $users = array("follow" => "'twitterusernameOne','twitterusernameTwo'"); $serializedUsers = urlencode(serialize($users)); $postFields = urlencode($users); // Create the connection handle $curl_conn = curl_init(); // Set cURL options curl_setopt($curl_conn, CURLOPT_URL, $url); //URL to connect to curl_setopt($curl_conn, CURLOPT_POST, 1); //Use POST method curl_setopt($curl, CURLOPT_POSTFIELDS, $post_fields); curl_setopt($curl_conn, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //Use basic authentication curl_setopt($curl_conn, CURLOPT_USERPWD, 'myusername:mypassword'); //Set u/p curl_setopt($curl_conn, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_conn, CURLOPT_RETURNTRANSFER, 1); //Return the result as string $output = curl_exec($curl_conn); curl_close($curl_conn); print_r($output);







Bookmarks