Hi all,

Could not find the answer to my question, as all blogposts mentioning
the "daterange" syntax won't give me any results.

I'm using PHP & the Google REST API.

For my thesis research, I'm trying to gather blogposts on a couple of
phrases for over the past year. I'm looking for the number of posts
mentioning these phrases on a daily basis. So not necessarily the
posts themselves, only the number per day.

However, the daterange parameter does not have the desired results. Is
this feature not possible for blogsearch or am I overlooking anything
else?

I've attached the code and, for the record, the old SOAP documentation
and the Google Hacks article on CNET (http://reviews.cnet.com/
4520-10165_7-6206764-2.html) do not solve my problem.

Thanks in advance!

<?php


function google_search_api($args, $referer = 'http://www.linelink.nl',
$endpoint = 'blogs'){


        $url = "http://ajax.googleapis.com/ajax/services/search/".$endpoint;

        if ( !array_key_exists('v', $args) )
                $args['v'] = '1.0';

        $url .= '?'.http_build_query($args, '', '&');
 echo ("$url <br/>");
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        curl_setopt($ch, CURLOPT_REFERER, $referer);
        $body = curl_exec($ch);
        curl_close($ch);

    $results = json_decode($body);

        return ($results);
}

$cursor = 0;

$rez = google_search_api(array(
                'q' => '"htc hero" daterange:'.gregoriantojd
('1','1','2009').'-'.gregoriantojd('1','2','2009'),
                'scoring' => 'd'


 ));

?>

--

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