Advertisement
Guest User

Untitled

a guest
Mar 7th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "github.com/k0kubun/pp"
  5. "gopkg.in/ahmdrz/goinsta.v2"
  6. )
  7.  
  8. const (
  9. userName = "..."
  10. userPassword = "..."
  11. configurationFile = "./.goinsta" // configuration file
  12. )
  13.  
  14. func main() {
  15. insta, err := goinsta.Import(configurationFile)
  16. if err != nil {
  17. pp.Println(err)
  18. }
  19.  
  20. if insta == nil {
  21. insta = goinsta.New(userName, userPassword)
  22. if err = insta.Login(); err != nil {
  23. pp.Println(err)
  24. return
  25. }
  26. insta.Export(configurationFile)
  27. }
  28.  
  29.  
  30. user, err := insta.Profiles.ByName("tadanokarisuma")
  31. if err != nil {
  32. pp.Println(err)
  33. return
  34. }
  35.  
  36. pp.Println(user.FollowerCount)
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement