Using this PHP snippet you can check the number of times your page URL was retweeted.
Syntax
1
2
3
4
5
6
7
8
9
10
|
function tweetCount($url) {
$content = file_get_contents("http://api.tweetmeme.com/url_info?url=".$url);
$element = new SimpleXmlElement($content);
$retweets = $element->story->url_count;
if($retweets){
return $retweets;
} else {
return 0;
}
}
|
1
2
3
4
5
|
<?php
$url = "http://blog.koonk.com";
$count = tweetCount($url);
return $count;
?>
|
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment