I have just coded twitter feed for my statuses fetching the xml. I was wondering if there is any link also for XML of mentions and hashtags
Asked
Active
Viewed 549 times
0
-
Regarding Hashtags this has already been answered here: http://stackoverflow.com/questions/2714471/twitter-api-display-all-tweets-with-a-certain-hashtag – Martin Jansen Feb 01 '12 at 06:24
-
Thank you but I rather use it with cURL – Tomas Smith Feb 02 '12 at 02:55
1 Answers
0
For twitter mentions:
function curlRequest($url, $post) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERPWD, "username:password");
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 20);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
// we are not using the $post variable yet, but stay tuned!
if ($post) {
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
}
return curl_exec($curl);
}
//then call this function as:
$contents= curlRequest(“http://twitter.com/statuses/mentions.xml”, FALSE);
$xml= new SimpleXMLElement($contents);
foreach($xml->status as $status) {
echo "<li>$status->text</li>";
}

Sudhir Bastakoti
- 99,167
- 15
- 158
- 162