28 lines
463 B
Go
Raw Normal View History

2017-06-26 21:41:16 +00:00
package main
import (
2019-04-23 05:52:55 +00:00
"github.com/akyoto/color"
2019-06-03 09:32:43 +00:00
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/arn/autocorrect"
2017-06-26 21:41:16 +00:00
)
func main() {
2017-11-01 19:11:05 +00:00
defer arn.Node.Close()
2017-06-26 21:41:16 +00:00
// Iterate over the stream
2017-11-01 19:11:05 +00:00
for post := range arn.StreamPosts() {
2017-06-26 21:41:16 +00:00
// Fix text
color.Yellow(post.Text)
2018-04-08 10:59:36 +00:00
post.Text = autocorrect.PostText(post.Text)
2017-06-26 21:41:16 +00:00
color.Green(post.Text)
// Tags
if post.Tags == nil {
post.Tags = []string{}
}
// Save
2017-11-01 19:11:05 +00:00
post.Save()
2017-06-26 21:41:16 +00:00
}
}