Hello,

I am trying to develop a feed reader using the API but for non
javascript browsers.
I am using php. Sometimes it returns JSON data immediately or it
doesn't return anything at all (empty). Is there a restriction on how
many requests i am doing? I tried to set a back-off timer (sleep)
between requests but still the same. Any idea why this happens ? Also
is there a non javascript way to call google.feeds.FeedControl class?
similar to the one with json ?

here is the function i am using
function getArray($link) {
        $url = "http://ajax.googleapis.com/ajax/services/feed/load?q=";.
$link."&v=1.0&key=***********my key******";
try {

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_REFERER, "***********my domain******");
        $body = curl_exec($ch);
        curl_close($ch);

        $json = json_decode($body);
        $entries = $json->responseData->feed->entries;
        if (empty($entries)) {
                $entries=null; throw new Exception('Tried to access '.$link); }
} catch(Exception $exp) {
        $headers = 'From: ***********my email******'. "\r\n" .
                        'X-Mailer: PHP/' . phpversion();
        mail("*****my email***", "error with feeds", $exp->getMessage(),
$headers);
}
        return $entries;
}// getArray

thanks,
George

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to