Skip to content

Instantly share code, notes, and snippets.

@ncla
Last active August 9, 2016 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncla/5cc90210e060e28a1c3ad77c888df7cb to your computer and use it in GitHub Desktop.
Save ncla/5cc90210e060e28a1c3ad77c888df7cb to your computer and use it in GitHub Desktop.
<?php
$page = 0;
$lastPage = false;
while ($lastPage === false) {
if ($page === 35) {
$page++;
continue;
}
$curl = new Curl();
$curl->setHeader('Accept', '*/*');
$curl->setHeader('Accept-Char', 'utf-8');
$curl->setHeader('Accept-Language', 'en-US,en;q=0.8,lv;q=0.6');
$curl->setHeader('Connection', 'keep-alive');
$curl->setHeader('Host', 'csgo.steamanalyst.com');
$curl->setHeader('Referer', 'http://csgo.steamanalyst.com/list');
$curl->setHeader('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/49.0.2623.108 Chrome/49.0.2623.108 Safari/537.36');
$curl->setHeader('X-Requested-With', 'XMLHttpRequest');
$curl->get('http://csgo.steamanalyst.com/list-ajax.php?order%5B%5D=az&p=' . $page);
if ($curl->httpStatusCode !== 200) {
throw new \ErrorException('Unexpected HTTP status code ' . $curl->httpStatusCode);
}
if ($curl->httpStatusCode === 200 && strlen($curl->response) === 0) {
$lastPage = true;
} else {
$this->parseList($curl->response);
$page++;
usleep(600);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment