aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2018-07-05 20:38:51 -0700
committerAdam Mathes <adam@trenchant.org>2018-07-05 20:38:51 -0700
commitc8bf5665f43d54dd61f90629d101b954dafe3c89 (patch)
tree13defc936fd813a3166c24bc093c51f6b4532651
parentc1a6657fb4a8f829f039565f30fead67f751a1a0 (diff)
downloadneko-c8bf5665f43d54dd61f90629d101b954dafe3c89.tar.gz
neko-c8bf5665f43d54dd61f90629d101b954dafe3c89.tar.bz2
neko-c8bf5665f43d54dd61f90629d101b954dafe3c89.zip
disable autocrawl since it seems broken
-rw-r--r--README.md4
-rw-r--r--main.go48
2 files changed, 27 insertions, 25 deletions
diff --git a/README.md b/README.md
index f20d94c..af79934 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/main.go b/main.go
index f807afe..8d417ad 100644
--- a/main.go
+++ b/main.go
@@ -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)