Coder Social home page Coder Social logo

Comments (5)

Hasokeyk avatar Hasokeyk commented on June 9, 2024

Merhabalar,

50 adeti instagram limitliyor bir nevi sayfalama mantığı. Diğer sayfaye geçmek için max_id gerekiyor. Sorgu cevabının en sonda "max_id" veya "nextmax_id" gibi bir parametre olmalı.

Öncelikle yapmanız gereken. InstagramUser.php dosyasında 785. satırdaki kod ile aşağıdakini değiştirin. Şu an kendi pc'm de değilim güncelleme çıkamıyorum.

aldığınız "max_id" parametresindeki tokeni bir döngü oluşturarak aynı fonksiyonu kullanarak sayfalar arası geçebilirsiniz.

public function get_my_followers($max_id = null){
    $user_id = $this->get_user_id();

    $url  = 'https://i.instagram.com/api/v1/friendships/'.$user_id.'/followers/?includes_hashtags=true&search_surface=follow_list_page&query=&enable_groups=true&rank_token=4c6947e0-bebe-4f69-a7bf-24be28dc4990&max_id='.($max_id);
    $json = $this->request->get($url);
    $json = json_decode($json['body']);

    return $json;
}

from instagram.

nihatxp avatar nihatxp commented on June 9, 2024

Merhabalar,

50 adeti instagram limitliyor bir nevi sayfalama mantığı. Diğer sayfaye geçmek için max_id gerekiyor. Sorgu cevabının en sonda "max_id" veya "nextmax_id" gibi bir parametre olmalı.

Öncelikle yapmanız gereken. InstagramUser.php dosyasında 785. satırdaki kod ile aşağıdakini değiştirin. Şu an kendi pc'm de değilim güncelleme çıkamıyorum.

aldığınız "max_id" parametresindeki tokeni bir döngü oluşturarak aynı fonksiyonu kullanarak sayfalar arası geçebilirsiniz.

public function get_my_followers($max_id = null){
    $user_id = $this->get_user_id();

    $url  = 'https://i.instagram.com/api/v1/friendships/'.$user_id.'/followers/?includes_hashtags=true&search_surface=follow_list_page&query=&enable_groups=true&rank_token=4c6947e0-bebe-4f69-a7bf-24be28dc4990&max_id='.($max_id);
    $json = $this->request->get($url);
    $json = json_decode($json['body']);

    return $json;
}

Dediğinizi yapmaya çalıştım ama malesef max_id diye bir bilgi gelmiyor

Söylediğinize benzer pk ve pk id vardı ama birbirlerinden çok bağımsız geliyordu her kullanıcıda,

  | [has_anonymous_profile_picture] => 1
  | [all_media_count] => 3
  | [liked_clips_count] => 21
  | [fbid_v2] => 17241465800311351
  | [interop_messaging_user_fbid] => 17842109166669408
  | [allowed_commenter_type] => any
  | [reel_auto_archive] => unset
  | [pk] => 49690812027 <----------------
  | [pk_id] => 49690812027 <----------------
  | [username] => XXXXXXX
  | [full_name] =>
  | [is_private] =>
  | [is_verified] =>
  | [profile_pic_url] => 
  | [account_badges] => Array
  | (
  | )
  |  
  | [latest_reel_media] => 0
  | [is_favorite] =>

bunları denedim işe yaramadı.

Zamanınız olduğunda bakabilir misiniz yanıtınızı bekliyor olacağım

from instagram.

Hasokeyk avatar Hasokeyk commented on June 9, 2024

Merhabalar,

Bu yolladığınız kullanıcı bilgisini içeren çıktı. Takipçileri getiren fonksiyon başka. Pc me ulaşınca bir güncelleme yollarım.

Siz kullandığınız kodu buraya yazabilir misiniz?

from instagram.

nihatxp avatar nihatxp commented on June 9, 2024

Kullandığım kodu aşağıya bıraktım. amacım sadece sayfalama ile de olsa herhangi bir kullanıcının takip listesinin tamamına erişmek.

use Hasokeyk\Instagram\Instagram;

require "../../vendor/autoload.php";

require_once "../config/config.php";

$instagram = new Instagram($username, $password);
$instagram->login->login();

$login = $instagram->login->login_control();
if ($login) {
    $q = "nihatxp";
    $user = $instagram->user->get_user_following($q);
    foreach ($user->users as $key => $value) {
        $img = base64_encode(file_get_contents($value->profile_pic_url));
        $value->profile_pic_url = "data:image/jpeg;base64," . $img;
    }
    print_r(json_decode(json_encode($user->users), true));

    $json = json_encode($user->users, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
    // Replace all colons with a single colon followed by a space to separate keys and values
    $json = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', $json);
} else {
    echo 'Login Fail';
}

Bunun dışında hep olmasa da bazen sorgu sonucu aşağıdaki hatayı alıyorum

<br />
<b>Deprecated</b>:  Implicit conversion from float 7254.46 to int loses precision in <b>C:\Wamp.NET\sites\localhost\Instagram-Scrapper\vendor\hasokeyk\instagram\src\Instagram\InstagramRequest.php</b> on line <b>359</b><br />
<br />
<b>Deprecated</b>:  Implicit conversion from float 7281.61 to int loses precision in <b>C:\Wamp.NET\sites\localhost\Instagram-Scrapper\vendor\hasokeyk\instagram\src\Instagram\InstagramRequest.php</b> on line <b>331</b><br />
<br />
<b>Deprecated</b>:  Implicit conversion from float 7302.459999999999 to int loses precision in <b>C:\Wamp.NET\sites\localhost\Instagram-Scrapper\vendor\hasokeyk\instagram\src\Instagram\InstagramRequest.php</b> on line <b>303</b><br />
<br />
<b>Deprecated</b>:  Implicit conversion from float 7318.99 to int loses precision in <b>C:\Wamp.NET\sites\localhost\Instagram-Scrapper\vendor\hasokeyk\instagram\src\Instagram\InstagramRequest.php</b> on line <b>387</b><br />

Ne olduğunu anlamadığım için kurcalamadım, bunu da not edeyim dedim

from instagram.

Hasokeyk avatar Hasokeyk commented on June 9, 2024

Merhabalar,

Geç döndüğüm için kusura bakmayın.

Yolladığınız hata php sürümünden kaynaklanıyor gibi. php7.4 kullanmanızı öneriririm. Eğer php.7.4 kullanıyorsanız lütfen bilgi verin.

from instagram.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.