19 messages in com.googlegroups.adwords-apiAdWords API Re: Get the zipped file b...
FromSent OnAttachments
dyuti18 Apr 2008 06:16 
Jan18 Apr 2008 10:23 
dshevnock18 Apr 2008 11:06 
Dyutiman Chaudhuri21 Apr 2008 22:40 
Dyutiman Chaudhuri21 Apr 2008 22:44 
Tomac21 Apr 2008 23:43 
Dyutiman Chaudhuri22 Apr 2008 00:24 
Dyutiman Chaudhuri24 Apr 2008 04:16 
Dyutiman Chaudhuri24 Apr 2008 04:22 
Jan24 Apr 2008 05:40 
Dyutiman Chaudhuri24 Apr 2008 07:14 
Jan24 Apr 2008 08:49 
dyuti29 Apr 2008 00:43 
Dyutiman Chaudhuri29 Apr 2008 00:48 
Jan29 Apr 2008 01:10 
Dyutiman Chaudhuri29 Apr 2008 02:45 
Jan29 Apr 2008 03:08 
Dyutiman Chaudhuri29 Apr 2008 04:48 
Jan29 Apr 2008 05:40 
Subject:AdWords API Re: Get the zipped file by url
From:Dyutiman Chaudhuri (dyut@gmail.com)
Date:04/24/2008 04:22:16 AM
List:com.googlegroups.adwords-api

Hi,

Look at my code which uses fopen(); <?php .... .... $handle = fopen($reportUrl['get'.$zipOrNot.'ReportDownloadUrlReturn'], "r"); $content = fread($handle, filesize($reportUrl['get'.$zipOrNot.'ReportDownloadUrlReturn'])); $handle1 = fopen('test.zip', "w+"); fwrite($handle1, $content); fclose($handle); fclose($handle1); ?>

And when I run the script I get

*Warning*: fopen( https://adwords.google.com/api/adwords/ReportDownload?t=AAAAABTiC4MAAAEZgCm3BAEAAAAARSRCr8R-nIxAlNTNZgCy-EtIBh1FMRYw) [function.fopen <http://localhost/adwords/function.fopen>]: failed to open stream: Invalid argument in *d:\wamp\www\adwords\get_zipped_report.php* on line *44*

*Warning*: filesize() [function.filesize<http://localhost/adwords/function.filesize>]: stat failed for https://adwords.google.com/api/adwords/ReportDownload?t=AAAAABTiC4MAAAEZgCm3BAEAAAAARSRCr8R-nIxAlNTNZgCy-EtIBh1FMRYwin *d:\wamp\www\adwords\get_zipped_report.php* on line *45*

*Warning*: fread(): supplied argument is not a valid stream resource in * d:\wamp\www\adwords\get_zipped_report.php* on line *45*

*Warning*: fclose(): supplied argument is not a valid stream resource in * d:\wamp\www\adwords\get_zipped_report.php* on line *48

*Does anybody has any idea??

- Dyutiman

On Fri, Apr 18, 2008 at 10:53 PM, Jan <piot@gmail.com> wrote:

How does your url look like?

I would just use fopen() to open and read the file, then fwrite() to write it locally to my harddisc. Then extract the file in it (use some library like pclzip.lib.php) and analyze the result (xml, csv, ...).

Or did I miss something that makes it complicated?