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