diff options
author | Adam Mathes <adam@trenchant.org> | 2018-07-05 20:38:51 -0700 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2018-07-05 20:38:51 -0700 |
commit | c8bf5665f43d54dd61f90629d101b954dafe3c89 (patch) | |
tree | 13defc936fd813a3166c24bc093c51f6b4532651 | |
parent | c1a6657fb4a8f829f039565f30fead67f751a1a0 (diff) | |
download | neko-c8bf5665f43d54dd61f90629d101b954dafe3c89.tar.gz neko-c8bf5665f43d54dd61f90629d101b954dafe3c89.tar.bz2 neko-c8bf5665f43d54dd61f90629d101b954dafe3c89.zip |
disable autocrawl since it seems broken
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | main.go | 48 |
2 files changed, 27 insertions, 25 deletions
@@ -122,7 +122,7 @@ You can add feeds directly from the command line for convenience -- ## Crawl Feeds -By default `neko` will crawl your feeds every 60 minutes while the interface is running, but if you want to manually crawl from the command line -- +Update feeds from the command line with -- $ neko --update @@ -159,8 +159,6 @@ Usage of neko: HTTP port to serve on (default 4994) -i, --imageproxy rewrite and proxy all image requests for privacy (experimental) - -m, --minutes int - minutes between crawling feeds (default 60) -p, --password string password to access web interface -u, --update @@ -10,13 +10,14 @@ import ( "adammathes.com/neko/web" "fmt" flag "github.com/ogier/pflag" - "time" ) +var Version, Build string + func main() { var help, update, verbose, proxyImages bool var dbfile, newFeed, export, password string - var port, minutes int + var port int // commands // no command tries to run the web server flag.BoolVarP(&help, "help", "h", false, "print usage information") @@ -27,7 +28,7 @@ func main() { // options with sensible defaults flag.StringVarP(&dbfile, "database", "d", "neko.db", "sqlite database file") flag.IntVarP(&port, "http", "s", 4994, "HTTP port to serve on") - flag.IntVarP(&minutes, "minutes", "m", 60, "minutes between crawling feeds") + // flag.IntVarP(&minutes, "minutes", "m", 60, "minutes between crawling feeds") flag.BoolVarP(&proxyImages, "imageproxy", "i", false, "rewrite and proxy all image requests for privacy (experimental)") flag.BoolVarP(&verbose, "verbose", "v", false, "verbose output") @@ -36,6 +37,7 @@ func main() { flag.Parse() if help { + fmt.Printf("neko v%s | build %s\n", Version, Build) flag.Usage() return } @@ -64,25 +66,27 @@ func main() { return } - go func() { - // ticker := time.NewTicker(time.Second*5) - if minutes < 1 { - return - } - ticker := time.NewTicker(time.Minute * time.Duration(minutes)) - defer ticker.Stop() - done := make(chan bool) - for { - select { - case <-done: - fmt.Println("done") - return - case t := <-ticker.C: - vlog.Printf("starting crawl at %s\n", t) - crawler.Crawl() - } - } - }() + // + // this doesn't seem quite right yet // will revise + // go func() { + // // ticker := time.NewTicker(time.Second*5) + // if minutes < 1 { + // return + // } + // ticker := time.NewTicker(time.Minute * time.Duration(minutes)) + // defer ticker.Stop() + // done := make(chan bool) + // for { + // select { + // case <-done: + // fmt.Println("done") + // return + // case t := <-ticker.C: + // vlog.Printf("starting crawl at %s\n", t) + // crawler.Crawl() + // } + // } + // }() vlog.Printf("starting web server at 127.0.0.1:%d\n", config.Config.Port) |