pulling mentions from twitter with php
I am trying to retrieve mentions from twitter using php. The current code I have works fine to retrieve the user_timeline, however when I try to use the same code for the mentions I get an authentication error. What is the best way to retrieve mentions with userid, pictures, text, etc included?
if I change user_time to mentions I get an authentication error.
Here is the code I use now to retrieve user_timeline with php.
<?php $xmldata = "http://twitter.com/statuses/user_time/usernid.xml"; $open = fopen($xmldata,'r'); $content = stream_get_contents($open); fclose($open); $xml = new SimpleXMLElement($content); $screenname = $xml->status->user->screen_name; ?>
You have to use OAUTH ("Returns the 20 most recent mentions (status containing @username) for the authenticating user."):