diff options
author | Adam Mathes <adam@trenchant.org> | 2017-04-17 10:39:41 -0700 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2017-04-17 10:39:41 -0700 |
commit | fad8d73db73a8e2b007ed52b8a0d8f5e347c0418 (patch) | |
tree | 6fd4a2aa3670dc06fd761dd00286b1b4adfe94a3 /web | |
parent | 0630c3cf75243a53e0e5b2b2a084ca28f5d335df (diff) | |
download | neko-fad8d73db73a8e2b007ed52b8a0d8f5e347c0418.tar.gz neko-fad8d73db73a8e2b007ed52b8a0d8f5e347c0418.tar.bz2 neko-fad8d73db73a8e2b007ed52b8a0d8f5e347c0418.zip |
crawl immediately on web feed add
Diffstat (limited to 'web')
-rw-r--r-- | web/web.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -4,6 +4,7 @@ import ( "adammathes.com/neko/config" "adammathes.com/neko/models/feed" "adammathes.com/neko/models/item" + "adammathes.com/neko/crawler" "encoding/json" "fmt" "golang.org/x/crypto/bcrypt" @@ -88,6 +89,11 @@ func feedHandler(w http.ResponseWriter, r *http.Request) { switch r.Method { case "POST": feed.NewFeed(f.Url) + f.ByUrl(f.Url) + ch := make(chan string) + // log.Println("crawling") + crawler.CrawlFeed(&f, ch) + log.Println(<-ch) case "PUT": f.Update() case "DELETE": |