Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Author : Denis Szalkowski Copyright (C) http://ww.dsfc.net
- Licence : GNU General Public Licence 3.0
- L'objet de ce code est, par scrapping, en utilisant les expressions régulières, de récupérer votre ID Instagram à partir de la page de votre profil https://www.instagram/bloginfo/.
- Après l'avoir copié sur un serveur Apache ou Nginx exécutant PHP, il s'utilise de la façon suivante :
- https://www.dsfc.net/instaid.php?profile=bloginfo
- */
- function file_get_contents_ssl($url)
- {
- $headers=array(
- 'Content-type:text/html;charset="utf-8"',
- 'Accept: text/html',
- );
- $ch=curl_init();
- curl_setopt($ch,CURLOPT_HEADER,false);
- curl_setopt($ch,CURLOPT_REFERER,'');
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Android 9.0; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0');
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_SSLVERSION,0);
- curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
- $html=curl_exec($ch);
- curl_close($ch);
- return $html;
- }
- $profile='bloginfo';
- if(isset($_GET['profile']))
- {
- $profile=$_GET['profile'];
- }
- $url='https://www.instagram.com/'.$profile.'/';
- $html=file_get_contents_ssl($url);
- if(preg_match_all('@"logging_page_id":"profilePage_([0-9]+)"@i',$html,$matches,PREG_PATTERN_ORDER))
- {
- echo $matches[1][0];
- }
- exit;
- ?>
Add Comment
Please, Sign In to add comment