|
|
|
@ -33,12 +33,16 @@ func main() {
|
|
|
|
|
entities := tweet["entities"].(map[string]interface{})
|
|
|
|
|
|
|
|
|
|
// Type assert media to be a list
|
|
|
|
|
mediaList := (entities["media"].([]interface{}))
|
|
|
|
|
mediaList := entities["media"].([]interface{})
|
|
|
|
|
|
|
|
|
|
// media := mediaList[0]
|
|
|
|
|
// Type assert the media to be a map
|
|
|
|
|
media := mediaList[0].(map[string]interface{})
|
|
|
|
|
|
|
|
|
|
fmt.Printf("%s => ", reflect.TypeOf(mediaList))
|
|
|
|
|
fmt.Println(mediaList)
|
|
|
|
|
// Get the link
|
|
|
|
|
imageUrl := media["media_url_https"]
|
|
|
|
|
|
|
|
|
|
fmt.Printf("%s => ", reflect.TypeOf(imageUrl))
|
|
|
|
|
fmt.Println(imageUrl)
|
|
|
|
|
|
|
|
|
|
//fmt.Println(tweet.Text())
|
|
|
|
|
}
|
|
|
|
|