1. PHP / Говнокод #15005

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    $infopage = file_get_contents("http://instagram.com/api/v1/users/".$match."/info/", false, $context);
    $isprivate = substr($infopage,strpos($infopage,',"is_private":')+14,strpos($infopage,',"external_url":"')-strpos($infopage,',"is_private":')-14);
    $fullname = substr($infopage,strpos($infopage,'","full_name":"')+15,strpos($infopage,'","follower_count":')-strpos($infopage,'","full_name":"')-15);
    $mediacount = substr($infopage,strpos($infopage,',"media_count":')+15,strpos($infopage,',"following_count":')-strpos($infopage,',"media_count":')-15);
    $following = substr($infopage,strpos($infopage,',"following_count":')+19,strpos($infopage,',"geo_media_count":')-strpos($infopage,',"following_count":')-19);
    $isint2 = is_numeric($following);
    if ($isint2 == false){$following = substr($infopage,strpos($infopage,',"following_count":')+19,strpos($infopage,',"profile_pic_url":"')-strpos($infopage,',"following_count":')-19);}
    $followers = substr($infopage,strpos($infopage,',"follower_count":')+18,strpos($infopage,',"pk":')-strpos($infopage,',"follower_count":')-18);
    $avatar = stripslashes(substr($infopage,strpos($infopage,'"profile_pic_url":"')+19,strpos($infopage,'","biography":"')-strpos($infopage,'"profile_pic_url":"')-19));
    $bio = substr($infopage,strpos($infopage,'","biography":')+15,strpos($infopage,'","full_name":"')-strpos($infopage,'","biography":')-15);
    $website = stripslashes(substr($infopage,strpos($infopage,'"external_url":"')+16,strpos($infopage,'"}}')-strpos($infopage,'"external_url":"')-16));
    $countq = mysql_query("SELECT COUNT(*) FROM `links` WHERE `ownerID` = '".$match."'");
    $countf = mysql_fetch_array($countq);

    Парсинг API Instagram. JSON - слишком неправославно, да.

    Запостил: olenyash, 26 Февраля 2014

    Комментарии (1) RSS

    Добавить комментарий