PHP CURL Google Calendar using Private URL

Posted by MooCow on Stack Overflow See other posts from Stack Overflow or by MooCow
Published on 2010-04-29T00:06:59Z Indexed on 2010/04/29 0:27 UTC
Read the original article Hit count: 436

Filed under:
|
|

I'm trying to get an array of events from Google Calendar using the Private URL. I read the Google API document but I want to try doing this without using the ZEND library since I have no idea what the eventual server file structure is and avoid having other people edit the codes.

I also did a search before posting and ran into the same condition where PHP CURL_EXEC returns false with the URL but I get a JSON file if the URL is open using a web browser. Since I'm using the Private URL, do I really need to authenticate against the Google server using ZEND? I'm trying to have PHP clean up the array before encoding it for Flash.

$URL = <string of the private URL from Google Calendar>
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$data = curl_exec($ch);
curl_close($ch);

$result = json_decode($data);

print '<pre>'.var_export($data,1).'</pre>';
Screen output >>> false

© Stack Overflow or respective owner

Related posts about php

Related posts about curl