This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dir = __DIR__.'/photos'; | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1', 6379); | |
function get($url) { | |
//curl get | |
echo $url."\n"; | |
$curlOptions = array( | |
CURLOPT_ENCODING => 'gzip,deflate', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getProxy() { | |
$data = json_decode(file_get_contents('http://gimmeproxy.com/api/getProxy'), 1); | |
if(isset($data['error'])) { // there are no proxies left for this user-id and timeout | |
echo $data['error']."\n"; | |
} | |
return isset($data['error']) ? false : $data['curl']; //gimmeproxy returns 'curl' field that is CURLOPT_PROXY-ready string, see curl_setopt($curl, CURLOPT_PROXY, $proxy); | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
use Milo\Github; //https://github.com/milo/github-api/ | |
header('Content-Type: application/json'); | |
$api = new Github\Api; | |
$token = new Milo\Github\OAuth\Token('your secret key here'); | |
$api->setToken($token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"khr/react-curl": "~2.0", | |
"sunra/php-simple-html-dom-parser": "~1.5" | |
} | |
} |