From fad8d73db73a8e2b007ed52b8a0d8f5e347c0418 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Mon, 17 Apr 2017 10:39:41 -0700 Subject: crawl immediately on web feed add --- web/web.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/web.go b/web/web.go index 4ed1c83..f2f2f8e 100644 --- a/web/web.go +++ b/web/web.go @@ -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": -- cgit v1.2.3