开发者

How download with php google trends/insign cvs file?

开发者 https://www.devze.com 2023-03-13 01:38 出处:网络
How download with p开发者_如何学JAVAhp google trends/insign cvs file? reproduce: go to : http://www.google.com/trends?q=london%2C+paris&ctab=0&geo=all&date=all&sort=0

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

精彩评论

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

关注公众号