【问题标题】:How download with php google trends/insign cvs file?如何使用 php google 趋势/使用 csv 文件下载?
【发布时间】:2011-06-15 17:04:05
【问题描述】:

如何用php google trends/insign cvs文件下载?

复制:

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

  2. 在此页面中存在通过单击下载包含所有查询结果数据的 cvs 文件的选项。 我需要通过 php。

谢谢,

约瑟夫

【问题讨论】:

标签: php


【解决方案1】:

look 上的file_get_contents 函数

<?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;
?>

【讨论】:

【解决方案2】:
$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');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多