Created
June 20, 2019 12:53
-
-
Save dandyraka/3802183f94bfaca03771cbe1ef70d795 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
set_time_limit(0); | |
function curl($fullurl, $kuki) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
// curl_setopt($ch, CURLOPT_VERBOSE, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); | |
curl_setopt($ch, CURLOPT_FAILONERROR, 0); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($ch, CURLOPT_URL, $fullurl); | |
curl_setopt($ch, CURLOPT_COOKIE, $kuki); | |
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
$returned = curl_exec($ch); | |
return ($returned); | |
} | |
$username = "xtrvts"; | |
$json = curl('https://www.instagram.com/' . $username . '/', false); | |
preg_match('/window._sharedData\s=\s(.*?);</', $json, $data); | |
echo $data[1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment