$url = 'https://www.instagram.com';
// $mode = array(); // настройки
// Пост ключ значение
$post = array('field' => 'value', 'field2' => 'value2');
$defaultmode = array('charset' => 'utf-8', 'ajax' => 0, 'ssl' => 1, 'cookie' => 1, 'headers' => 1, 'useragent' => 'Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.10.229 Version/11.61');
foreach ($defaultmode as $k => $v) {
if (!isset($mode[$k]) ) {
$mode[$k] = $v;
}
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, $mode['headers']);
if (!$mode['ref']) {
curl_setopt($ch, CURLOPT_REFERER, $url);
} else {
curl_setopt($ch, CURLOPT_REFERER, $mode['ref']);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $mode['useragent']);
curl_setopt($ch, CURLOPT_ENCODING, $mode['charset']);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 200);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if ($mode['cookie']) {
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . 'cookies.txt');
}
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
if ($mode['ssl']) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
if ($mode['ajax']) {
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Requested-With: XMLHttpRequest", "Content-Type: application/x-www-form-urlencoded; charset=UTF-8"));
}
$data = curl_exec($ch);
curl_close($ch);
$ch = curl_init('https://www.instagram.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$result = curl_exec($ch);
preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches);
$cookies = array();
foreach($matches[1] as $item) {
parse_str($item, $cookie);
$cookies = array_merge($cookies, $cookie);
}
var_dump($cookies);
FROM users_auth AS u1, users_auth AS u2
LEFT join users AS u0
on u0.id = u2.user_id
FROM users u1
join users_auth ua1 ON ua1.user_id = u1.id
join users u2 ON u2.id != u1.id
join users_auth ua2 ON ua2.user_id = u2.id
SELECT u1.*, ua1.*
FROM users u1
join users_auth ua1 ON ua1.user_id = u1.id
join users u2 ON u2.id != u1.id
join users_auth ua2 ON ua2.user_id = u2.id
WHERE ua1.user_agent = ua2.user_agent
AND ua1.langs = ua2.langs
GROUP BY u1.id ORDER BY ua1.user_agent, ua1.langs