Beispiel #1
0
 def process_feed(self, feed_obj):
     """Processes sinlge feed"""
     parsed_feed = ps.parse_feed(feed_obj)
     schema.sanitize(parsed_feed)
     for data in ProcessManager.process_feed_content(parsed_feed):
         data["rss_id"] = feed_obj.rss_id
         data["data_id"] = db.insert_update_data(data)
         db.insert_update_tokenized(data)
         self.processed_items += 1
     parsed_feed["rss_id"] = feed_obj.rss_id
     db.insert_update_feed(parsed_feed)
Beispiel #2
0
 def process_feed_content(parsed_feed):
     """Processes sinlge feed content"""
     for parsed_content in ps.parse_content(parsed_feed):
         schema.sanitize(parsed_content)
         schema.serialize(parsed_content)
         yield {
             "identifier": parsed_content["identifier"],
             "published": parsed_content["published_parsed"],
             "description": parsed_content["description"],
             "description_hash": parsed_content["description_hash"],
             "title": parsed_content["title"],
             "link": parsed_content["link"],
             "tokenized_count": parsed_content["tokenized_count"],
             "tokenized_plain": parsed_content["tokenized_plain"],
         }