PHP CURL Google Calendar using Private URL -
i'm trying array of events google calendar using private url. read google api document want try doing without using zend library since have no idea eventual server file structure , avoid having other people edit codes.
i did search before posting , ran same condition php curl_exec returns false url json file if url open using web browser. since i'm using private url, need authenticate against google server using zend? i'm trying have php clean array before encoding flash.
$url = <string of private url 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
you can "roll own" authsub or oauth implementation:
the following summarized from: http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html#auth
to acquire authsub token given user, application must redirect user authsubrequest url, prompts them log google account. authsubrequest url might this:
then this...
get /accounts/authsubsessiontoken http/1.1 content-type: application/x-www-form-urlencoded authorization: authsub token="yourauthtoken" user-agent: java/1.5.0_06 host: https://www.google.com accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 connection: keep-alive
then this...
get /calendar/feeds/default/private/full http/1.1 content-type: application/x-www-form-urlencoded authorization: authsub token="yoursessiontoken" user-agent: java/1.5.0_06 host: www.google.com accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 connection: keep-alive
more docs authsub:
Comments
Post a Comment