aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/nekoimport.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/cmd/nekoimport.go b/cmd/nekoimport.go
new file mode 100644
index 0000000..c599478
--- /dev/null
+++ b/cmd/nekoimport.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ _ "neko/util"
+ "neko/models/feed"
+ "fmt"
+ "io/ioutil"
+ "log"
+ "os"
+ "strings"
+)
+
+func main() {
+ if len(os.Args) < 2 {
+ fmt.Printf("usage: nekoimport config.json <feeds.txt>\n\n format is one URL per line\n")
+ }
+
+ fb, err := ioutil.ReadFile(os.Args[2])
+ if err != nil {
+ log.Fatal("could not read file\n")
+ }
+
+ feeds := strings.Split(string(fb), "\n")
+ for _,f := range feeds {
+ feed.NewFeed(f)
+ }
+}