ahmdrz / goinsta

Unofficial Instagram API written in Golang
MIT License
895 stars 247 forks source link

Does "follow" method really works? #4

Closed KatieKat12 closed 7 years ago

KatieKat12 commented 7 years ago

I have just tried to write a sample script:

insta := goinsta.New("CORRECT_USER", "CORRECT_PASS")
if err := insta.Login(); err != nil {
    panic(err)
}

defer insta.Logout()
_, err := insta.Follow("CORRECT_ID")
if err != nil {
    fmt.Println(err)
}

And it doesn't work, but if I do it manually and then just call 'unfollow' with the same ID, it works (it unfollows)

ahmdrz commented 7 years ago

Hi , Thank you for using this library , I will check it as soon as possible

ahmdrz commented 7 years ago

I wrote this code :

package main

import (
    "fmt"

    "github.com/ahmdrz/goinsta"
)

func main() {
    insta := goinsta.New("username", "password")
    err := insta.Login()
    if err != nil {
        panic(err)
    }
    defer insta.Logout()

    user, _ := insta.GetUsername("anotherusername")
    fmt.Println(user.User.StringID())
    _, err = insta.Follow(user.User.StringID())
    if err != nil {
        fmt.Println(err)
    }
}

It's worked for me !

KatieKat12 commented 7 years ago

Now it works for me too. But sometimes after quite a few requests I've got err==nil and resp.Status == "ok" but when I print resp.FriendShipStatus.Following, it is false

I believe, that it is a kind of a ban from Instagram, so I have to wait until it is over. But it would be more sensible if I had an error != nil or status != "ok"

KatieKat12 commented 7 years ago

Sorry for really late answering.

I mean, that if I make too many "follow" calls, then Instagram bans my actions and do not approve them. But the follow method do not send any errors or warnings about it.

It can be noticed by checking resp.FriendShipStatus.Following (it is false after a "follow" method call)

ahmdrz commented 7 years ago

Hi @KatieKat1 , Thanks for your notice. If you can please make a pull request and I will merge it as soon as possible. Regards.