Completed

Tags Instagram

Published on the March 16, 2017 in IT & Programming

About this project

Open

Eu tenho uma função PHP que estava funcionando e agora não está mais. Eu preciso que ela volte a funcionar.
Basicamente o código é esse:
<?php
$results_array = scrape_insta_tag('love');
echo "<pre>";
print_r($results_array);
echo "</pre>";
function scrape_insta_tag($tag) {
    $opts = array('http' => array('header' => "User-Agent:MyAgent/1.0\r\n"));
    $context = stream_context_create($opts);
    $insta_source = file_get_contents('https://www.instagram.com/explore/tags/'.$Tag,FALSE,$context);
    $shards = explode('window._sharedData = ', $insta_source);
    $insta_json = explode(';</script>', $shards[1]);
    $insta_array = json_decode($insta_json[0], TRUE);
    return $insta_array;
}
?>
Já esse código está funcionando:
function scrape_insta('instagram') {
    $opts = array('http' => array('header' => "User-Agent:MyAgent/1.0\r\n"));
    $context = stream_context_create($opts);
    $insta_source = file_get_contents('http://instagram.com/'.$Username,FALSE,$context);
    $shards = explode('window._sharedData = ', $insta_source);
    $insta_json = explode(';</script>', $shards[1]);
    $insta_array = json_decode($insta_json[0], TRUE);
    return $insta_array;
}
Espero que o freelancer conserte a função scrape_insta_tag() para que ela volte a funcionar e me retorne informações tais como as que a função scrape_insta() retorna. O freelancer deve testar a função com outras hashtags antes de me entregar o trabalho.

Category IT & Programming
Subcategory Web development
What is the scope of the project? Small change or bug
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
Experience in this type of projects Yes (I have managed this kind of project before)
Roles needed Developer

Delivery term: Not specified

Skills needed

PHP