Not wasting a second, check out this code:
$gp=$_GET["gp"];
function googleplus($gp) {
$furl = "http://query.yahooapis.com/v1/public/yql?q=SELECT * from html where url='https://plus.google.com/%252B".$gp."' AND xpath=\"//div[@class='Nn']//div[@class='rw Uc']//div[@class='Zi']//div[@class='V9b nhe']//div[@class='tQE8Kd BnqoOb']//div[@class='Qhb eZa']//div[@class='vkb']//p\"&format=xml";
$api = simplexml_load_file($furl);
$followers = $api->results->p;
return $followers;
}
Okay. When I do
<?php echo googleplus($gp); ?>
with parameter gp=mehulmohan in the URL, it should return something like this:
539 have him in circles
Check this URL associated with mehulmohan
But actually, it returns blank. Why?
Please help. All other social media like pinterest and twitter are returning correct results but Google+ returns blank.
Point to note: I've parsed the "+" symbol 2 times in the URL as in 1 time, it is not accepting the XML but second time it takes.
"+" = %2B = %252B