示例#1
0
func main() {
	//Load the Client ID from a file called config.txt
	api := instago.InstagramAPI{}
	clientId, _ := ioutil.ReadFile("config.txt")
	api.ClientID = string(clientId)

	fmt.Println("INSTAGO DEMO")
	fmt.Println("============")
	fmt.Println("Enter a tag:")

	var tag string
	fmt.Scan(&tag)

	tagInfo := api.TagInfo(tag)
	fmt.Println("Tag: ", tagInfo.Tag, "Total: ", tagInfo.MediaCount)

	images := api.TagRecent(tag, "", "")
	for _, img := range images {
		fmt.Println(img.User, img.Filter)
	}

	fmt.Println("Similar tags")
	tags := api.TagSearch(tag)
	for _, tag := range tags {
		fmt.Println("Tag: ", tag.Tag, "Total: ", tag.MediaCount)
	}
}
示例#2
0
func main() {
	//Load the Client ID from a file called config.txt
	api := instago.InstagramAPI{}
	clientId, _ := ioutil.ReadFile("config.txt")
	api.ClientID = string(clientId)

	fmt.Println("INSTAGO DEMO")
	fmt.Println("============")
	fmt.Println("Popular ATM:")

	images := api.Popular()

	for _, image := range images {
		fmt.Println("User:"******"Filter:", image.Filter, "Likes:", image.Likes)
	}

	fmt.Println("====================")
	fmt.Println("Posted in Manhattan:")

	//I damn hope I got these right!
	imagesNY := api.LocationSearch(40.7142, -74.0064, 4500)
	for _, image := range imagesNY {
		fmt.Println("User:"******"Location:", image.Location.Name, "Coords:", image.Location.Latitude, image.Location.Longitude)
	}
}
示例#3
0
func main() {
	//Load the Client ID from a file called config.txt
	api := instago.InstagramAPI{}
	clientId, _ := ioutil.ReadFile("config.txt")
	api.ClientID = string(clientId)

	fmt.Println("INSTAGO  DEMO")
	fmt.Println("=============")
	fmt.Println("Enter a user:"******"Username:"******"Full Name:", user.FullName)
	}

	//Present basic inforamtion about the user
	fmt.Println("More detail on @" + users[0].Username)
	user := api.UserDetail(users[0].ID)
	fmt.Println("ID:", user.ID)
	fmt.Println("Username:"******"Full name:", user.FullName)
	fmt.Println("Bio:", user.Bio)
	fmt.Println("Website:", user.Website)
	fmt.Println("Follows:", user.TotalFollows)
	fmt.Println("Followers:", user.TotalFollowers)
	fmt.Println("Images:", user.TotalImages)
}
func main() {
	//Load the Client ID from a file called config.txt
	api := instago.InstagramAPI{}
	clientId, _ := ioutil.ReadFile("config.txt")
	api.ClientID = string(clientId)

	fmt.Println("   INSTAGO  DEMO   ")
	fmt.Println("===================")
	fmt.Println("Posts at Instagram:")

	//Instagram HQ
	imagesInstagram := api.LocationPosts("514276", "", "")

	for _, image := range imagesInstagram {
		fmt.Println("User:"******"Filter:", image.Filter, "Likes:", image.Likes)
	}

	fmt.Println("===============================")
	fmt.Println("Locations near the Eiffel Tower")

	//Locations near the Eiffel Tower
	locationsInParis := api.LocationsNear(48.858844, 2.294351, 0)

	for _, loc := range locationsInParis {
		fmt.Println("Name:", loc.Name, "Coords:", loc.Latitude, loc.Longitude)
	}
}