Skip to content

Instantly share code, notes, and snippets.

@kkirsanov
Created February 8, 2012 13:19
Show Gist options
  • Select an option

  • Save kkirsanov/1769434 to your computer and use it in GitHub Desktop.

Select an option

Save kkirsanov/1769434 to your computer and use it in GitHub Desktop.
<?php
header("Content-type: csv/plain");
$cursor="";
$id=$_GET['id'];#12345
$week=int($_GET['week']);
$year=int($_GET['year']);
while(1){
$url="http://parnter.sms2ru.ru/project/downloadsms/?id=$id&week=$week&year=$year&cursor=$cursor&csv=1";
$page=file_get_contents($url);
$data = json_decode($page, True);
$cnt = $data['cnt'];
if ($cnt==0)
break;
$cursor=$data['cursor'];
echo $data[html];
flush();
};
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment