Exemplo n.º 1
0
def sources_post():
    feed_url = request.form['feed']
    parsed = feed.parse(feed_url)
    feed_source = feed.get_source(parsed)
    source = FeedSource.insert_from_feed(feed_url, feed_source)
    feed_articles = feed.get_articles(parsed)
    Article.insert_from_feed(source.sid, feed_articles)
    return redirect('/sources')
Exemplo n.º 2
0
async def rss_data(feed_input: feed_input):
    f = feed.parse(feed_input.url)
    return f
Exemplo n.º 3
0
def test_parse():
    assert feed.parse('https://weather.gc.ca/rss/city/on-149_e.xml') != None
Exemplo n.º 4
0
def update_source(src):
    parsed = feed.parse(src.feed)
    feed_articles = feed.get_articles(parsed)
    article.Article.insert_from_feed(src.id, feed_articles)
    print('Updated '+ src.feed)
Exemplo n.º 5
0
def sources_post():
    feed_url = request.form['feed']
    parsed = feed.parse(feed_url)
    feed_source = feed.get_source(parsed)
    source = Source.insert_from_feed(feed_url, feed_source)
    return redirect('/sources')