Example #1
0
 def post(self, collection):
     """Crawl collection"""
     try:
         Crawler.crawl_and_save_articles_and_keywords(collection)
         return (
             json.dumps({"success": True}),
             200,
             {
                 "ContentType": "application/json"
             },
         )
     except:
         return (
             json.dumps({"success": False}),
             500,
             {
                 "ContentType": "application/json"
             },
         )
Example #2
0
def crawl(collection):
    Crawler.crawl_and_save_articles_and_keywords(collection)