stories

package
v0.0.0-...-bcdd4fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2019 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:     "stories",
	Short:   "Get stories of a user",
	Example: "goinsta user stories robpike",
	Run: func(cmd *cobra.Command, args []string) {
		cmd = cmd.Root()

		output, err := cmd.Flags().GetString("output")
		if err != nil || output == "" {
			output = "./timeline/stories/"
		}
		inst := utils.New()

		tray, err := inst.Timeline.Stories()
		if err != nil {
			fmt.Println(err)
			return
		}

		fmt.Println("Downloading your timeline stories")
		for _, media := range tray.Stories {
			out := fmt.Sprintf("%s/%s/", output, media.User.Username)
			pgb := pb.StartNew(len(media.Items))
			for _, item := range media.Items {
				_, _, err := item.Download(out, "")
				if err != nil {
					fmt.Println(err)
				}
				pgb.Add(1)
			}
			pgb.Finish()
		}
	},
}

RootCmd is used as a command line interaction with Instagram Timeline Stories.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL