abjerner / Skybrud.Social.Pinterest

Skybrud.Social authentication and service implementation for the Pinterest API.
http://social.skybrud.dk/pinterest/
MIT License
0 stars 1 forks source link

how to get followers? #3

Open elmagekmosaad opened 5 years ago

elmagekmosaad commented 5 years ago

hi i can get info for any user but can't get follower and can't know how to do this any hlep?

abjerner commented 5 years ago

@elmagekmosaad you can get the follower count by requesting information about the user. How to achieve that is described here:

https://social.skybrud.dk/pinterest/endpoints/users/getting-information-about-a-given-user/

Getting a list of actual followers is not supported yet.

elmagekmosaad commented 5 years ago

list of actual followers

opps i want list of actual followers whene you will add and i want thank you for this lib it's exellent ♥

abjerner commented 5 years ago

@elmagekmosaad I'll add it to my TODO, but as I maintain this package in my spare time, I can't make any promises for when I can add support for this.

Meanwhile, you can still use this package to make the requests to the Pinterest API, but then parse the response manually - eg. like:

@using Newtonsoft.Json.Linq
@using Skybrud.Essentials.Json.Extensions
@using Skybrud.Social.Http
@inherits WebViewPage<Skybrud.Social.Pinterest.PinterestService>

@{

    // Make the call to the Pinterest API
    SocialHttpResponse response = Model.Client.DoHttpGetRequest("/v1/me/followers");

    // Parse the response body
    JObject body = JObject.Parse(response.Body);

    foreach (JObject follower in body.GetObjectArray("data")) {

        string url = follower.GetString("url");
        string firstName = follower.GetString("first_name");
        string lastName = follower.GetString("last_name");
        string id = follower.GetString("id");

    }

}
elmagekmosaad commented 5 years ago

image i have this error what i can do to fix it ?!! @abjerner

elmagekmosaad commented 5 years ago

please give me small example doing this

abjerner commented 5 years ago

The example it self should still be fine, but the access token appears to be invalid.

elmagekmosaad commented 5 years ago

The example it self should still be fine, but the access token appears to be invalid.

How wrong I open the program and ask between the code and then put it in the program and bring the AXS Token and also I can extract my account data but when executing the code you sent me this error appears Can you send me a simple project that does so until I see it

@abjerner

elmagekmosaad commented 5 years ago

@abjerner

abjerner commented 5 years ago

@elmagekmosaad The code works fine. Your issue is at the API level, and not in the code. You're more than welcome to check the official Pinterest API documentation on why you then get an error:

https://developers.pinterest.com/docs/api/users/#fetch-follow-data

For instance, as you can see from the link above, the followers endpoint requires the read_relationships scope.

elmagekmosaad commented 5 years ago

i got all scope

elmagekmosaad commented 5 years ago

@abjerner https://api.pinterest.com/oauth/?client_id=5003164149983764750&scope=read_public,write_public&response_type=code&redirect_uri=http://mg-control.com/&state=768uyFys