I'm trying to get Instagram follower numbers, but I always see 0 when I go out.
I will be glad if you help I will be glad if you help
I'm trying to learn instasharperi, I'm trying to do a lot of automation related to the subject. I'm trying to learn instasharperi, I'm trying to do a lot of automation related to the subject.
using InstaSharper.API;
using InstaSharper.API.Builder;
using InstaSharper.Classes;
using InstaSharper.Classes.Models;
using InstaSharper.Logger;
namespace instgram
{
public class Class1
{
#region Hidden
private const string username = "***"; //instagram username
private const string password = "***"; //instagram Password
#endregion
private static UserSessionData user;
private static IInstaApi api;
static void Main(string[] args)
{
user = new UserSessionData();
user.UserName = username;
user.Password = password;
Login();
Console.Read();
}
public static async void Login()
{
api = InstaApiBuilder.CreateBuilder()
.SetUser(user)
.UseLogger(new DebugLogger(LogLevel.Exceptions))
.SetRequestDelay(RequestDelay.FromSeconds(8, 8))
.Build();
var loginRequest = await api.LoginAsync();
if (loginRequest.Succeeded)
{
Console.WriteLine("Logged in");
PullUserPosts("rterdogan");
}
else
{
Console.WriteLine("Error Logged in\n" + loginRequest.Info.Message);
}
}
public static async void PullUserPosts(string sUserName)
{
IResult<InstaUser> rat = await api.GetUserAsync(sUserName);
Console.WriteLine($"Number of Followers : {(rat.Value.FollowersCount)}");
}
}
}