28 lines
463 B
Go
Raw Normal View History

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