Exemplo n.º 1
0
    def create_site(cls, url):
        # first check if exist the same site
        feed_link = get_feed_link(url)
        if feed_link is None:
            raise CannotGetFeedSite(url)
        if FeedSite.query.filter_by(url=feed_link).count() > 0:
            return

        site = FeedSite(url)
        db.session.add(site)
        db.session.commit()
        add_update_task(site.id)
Exemplo n.º 2
0
    def create_site(cls, url):
        # first check if exist the same site
        feed_link = get_feed_link(url)
        if feed_link is None:
            raise CannotGetFeedSite(url)
        if FeedSite.query.filter_by(url=feed_link).count() > 0:
            return

        site = FeedSite(url)
        db.session.add(site)
        db.session.commit()
        add_update_task(site.id)
Exemplo n.º 3
0
 def __init__(self, url):
     feed_link = get_feed_link(url)
     if feed_link is None:
         raise CannotGetFeedSite(url)
     self.url = feed_link
     feed_data = FeedData(feed_link, True)
     feed_data.init_data()
     self.title =  feed_data.site_title
     updated = feed_data.site_updated
     if updated is not None:
         self.updated = updated
     else:
         self.updated = datetime.datetime.now()
Exemplo n.º 4
0
 def __init__(self, url):
     feed_link = get_feed_link(url)
     if feed_link is None:
         raise CannotGetFeedSite(url)
     self.url = feed_link
     feed_data = FeedData(feed_link, True)
     feed_data.init_data()
     self.title = feed_data.site_title
     updated = feed_data.site_updated
     if updated is not None:
         self.updated = updated
     else:
         self.updated = datetime.datetime.now()