cli: show items always in the same way
This commit is contained in:
parent
eba2afc746
commit
ada6c45a0a
|
|
@ -147,12 +147,7 @@ func performCommands(sub microsub.Microsub, commands []string) {
|
||||||
timeline := sub.TimelineGet("", "", channel)
|
timeline := sub.TimelineGet("", "", channel)
|
||||||
|
|
||||||
for _, item := range timeline.Items {
|
for _, item := range timeline.Items {
|
||||||
fmt.Println("--------------------------")
|
showItem(&item)
|
||||||
if item.Name == "" && item.Content != nil {
|
|
||||||
fmt.Println(item.Content.HTML)
|
|
||||||
} else {
|
|
||||||
fmt.Println(item.Name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,12 +165,7 @@ func performCommands(sub microsub.Microsub, commands []string) {
|
||||||
timeline := sub.PreviewURL(url)
|
timeline := sub.PreviewURL(url)
|
||||||
|
|
||||||
for _, item := range timeline.Items {
|
for _, item := range timeline.Items {
|
||||||
fmt.Println("--------------------------")
|
showItem(&item)
|
||||||
if item.Name == "" && item.Content != nil {
|
|
||||||
fmt.Println(item.Content.HTML)
|
|
||||||
} else {
|
|
||||||
fmt.Println(item.Name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -199,3 +189,13 @@ func performCommands(sub microsub.Microsub, commands []string) {
|
||||||
sub.UnfollowURL(uid, url)
|
sub.UnfollowURL(uid, url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func showItem(item *microsub.Item) {
|
||||||
|
fmt.Printf("------- %s\n", item.Published)
|
||||||
|
if item.Name == "" && item.Content != nil {
|
||||||
|
fmt.Println(item.Content.HTML)
|
||||||
|
} else {
|
||||||
|
fmt.Println(item.Name)
|
||||||
|
}
|
||||||
|
fmt.Println(item.URL)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user