display urls to included media
This commit is contained in:
parent
cf9cd541b4
commit
e986f0d7df
26
drivel.go
26
drivel.go
|
@ -507,15 +507,31 @@ func quote(args []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Status struct {
|
type Status struct {
|
||||||
Full_text string
|
Full_text string
|
||||||
Id_str string
|
Id_str string
|
||||||
User StatusUser
|
User StatusUser
|
||||||
Quoted_status *Status
|
Quoted_status *Status
|
||||||
Retweeted_status *Status
|
Retweeted_status *Status
|
||||||
|
Extended_entities Entities
|
||||||
|
}
|
||||||
|
|
||||||
|
type Entities struct {
|
||||||
|
Media []Media
|
||||||
|
}
|
||||||
|
|
||||||
|
type Media struct {
|
||||||
|
Media_url string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Status) String() string {
|
func (m Status) String() string {
|
||||||
s := m.User.Name + " " + "(" + m.Id_str + ")" + ":\n" + m.Full_text
|
s := m.User.Name + " " + "(" + m.Id_str + ")" + ":\n" + m.Full_text
|
||||||
|
allMedia := m.Extended_entities.Media
|
||||||
|
if len(allMedia) > 0 {
|
||||||
|
s += "\n\nMedia:"
|
||||||
|
for _, media := range allMedia {
|
||||||
|
s += " " + media.Media_url
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.Quoted_status != nil {
|
if m.Quoted_status != nil {
|
||||||
s += "\n\nQuotes " + m.Quoted_status.String()
|
s += "\n\nQuotes " + m.Quoted_status.String()
|
||||||
} else if m.Retweeted_status != nil {
|
} else if m.Retweeted_status != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user