php cookie javascript document write document cookie useragent Mozilla

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
$cookie = ""; // javascript:document.write(document.cookie);
$useragent = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; ru; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://leprosorium.ru/api/lepropanel/");
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$result = curl_exec($ch);
curl_close($ch);
preg_match('/"rating":"(.+?)"/', $result, $matches);
$rating = $matches[1];
preg_match('/"karma":"(.+?)"/', $result, $matches);
$karma = $matches[1];
echo "Leprosorium\r\n";
echo "My karma: ".$karma."\r\n";
echo "My rating: ".$rating."\r\n";
?>