开发者

How download with php google trends/insign cvs file?

How download with p开发者_如何学JAVAhp google trends/insign cvs file?

reproduce:

  1. go to : http://www.google.com/trends?q=london%2C+paris&ctab=0&geo=all&date=all&sort=0

  2. in this page exist option to download cvs file that have all query result data by click. I need to that by php.

Thanks,

Yosef


look on the file_get_contents function

<?php
$csv = file_get_contents('http://www.google.com/trends/viz?q=london,+paris&date=all&geo=all&graph=all_csv&sort=0&sa=N');    
echo $csv;
?>


$query   = 'london, paris';
$csvFile = 'http://www.google.com/trends/viz?q='.urlencode($query).'&date=all&geo=all&graph=all_csv&sort=0&sa=N';

file_put_contents(file_get_contents($link), 
                  str_replace(array(',', ' ') '-', $query).'.cvs');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜