Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "following", Short: "Get user following", Example: "goinsta user following robpike", Run: func(cmd *cobra.Command, args []string) { if len(args) == 0 { fmt.Println("Missing args. See example.") return } inst := utils.New() user, err := inst.Profiles.ByName(args[0]) if err != nil { id, _ := strconv.ParseInt(args[0], 10, 64) user, err = inst.Profiles.ByID(id) if err != nil { fmt.Printf("Invalid username or id: %s\n", args[0]) return } } users := user.Following() i := 0 fmt.Println("Followers:\n ID\t\tUsername") for users.Next() { for _, u := range users.Users { i++ fmt.Printf(" %d\t%s\n", u.ID, u.Username) } } fmt.Printf("Total: %d\n", i) }, }
RootCmd is used as a command line interaction with Instagram get user following method.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.