Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Created January 31, 2011 19:43
Show Gist options
  • Save Mikulas/804656 to your computer and use it in GitHub Desktop.
Save Mikulas/804656 to your computer and use it in GitHub Desktop.
TwiDAQ API
<?php
$uri = 'http://twidaq.com/account/my-portfolio/';
$session = ''; // Tohle je jedinej problém, ale má velikou expiraci, takže to stačí jednou za čas opravit
$domain = 'twidaq.com';
$path = '/';
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $uri);
// curl_setopt($c, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($c, CURLOPT_VERBOSE, FALSE);
curl_setopt($c, CURLOPT_COOKIE, "PHPSESSID=$session; path=$path");
curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_0; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10');
$response = curl_exec($c);
echo $response;
curl_close($c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment