aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-04-17 10:39:41 -0700
committerAdam Mathes <adam@trenchant.org>2017-04-17 10:39:41 -0700
commitfad8d73db73a8e2b007ed52b8a0d8f5e347c0418 (patch)
tree6fd4a2aa3670dc06fd761dd00286b1b4adfe94a3 /web
parent0630c3cf75243a53e0e5b2b2a084ca28f5d335df (diff)
downloadneko-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.go6
1 files changed, 6 insertions, 0 deletions
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":