2017-06-26 21:41:16 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-04-23 05:52:55 +00:00
|
|
|
"github.com/akyoto/color"
|
2017-06-26 21:41:16 +00:00
|
|
|
"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
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|