aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/nekoimport.go
blob: 65f7b8ff3456b5c5fd4374b47ddd2d6a89ec3106 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

import (
	_ "adammathes.com/neko/util"
	"adammathes.com/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)
	}
}