Skip to content

Instantly share code, notes, and snippets.

View lnovy's full-sized avatar

Lukáš Nový lnovy

View GitHub Profile
@lnovy
lnovy / webcrawler.js
Last active January 7, 2016 09:36 — forked from amoilanen/webcrawler.js
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
$idfile = $_GET["id"]; //a to se rovna 1
while (false!==($file = readdir($vypis)))
{
$idcko = ($idcko + 1);
$idckoo = "&idcko=".$idcko."";
$image[$idckoo] = $file;
}
// ukonceni while apod
echo $image[$idfile]; //mi nevypise zhola nic a melo by to vypsat nazev souboru ve slozce, ktery je hned vedle