28 lines
440 B
Go
Raw Normal View History

2017-06-26 21:41:16 +00:00
package main
import (
"github.com/animenotifier/arn"
2017-07-06 13:04:51 +00:00
"github.com/animenotifier/arn/autocorrect"
2017-06-26 21:41:16 +00:00
"github.com/fatih/color"
)
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
}
}