Quantcast
Viewing all articles
Browse latest Browse all 106

RSS feeds in FiraBase database with Python Script?

I would like to load RSS feeds into a Firebase database.With feedparser I can parse the RSS feeds, that works very well.Also the FireaBase database is connected and I can add data there but I want use a variable in Line 27doc_ref = db.collection(u'Tagesschau').document(u'Test')

"Test" should be replaced by a variable, in my case the variable "article_title"

import feedparserimport sslimport firebase_adminfrom firebase_admin import credentials, firestorecred = credentials.Certificate("./gauth.json")firebase_admin.initialize_app(cred)db = firestore.client()article_title = "123"if hasattr(ssl, '_create_unverified_context'):    ssl._create_default_https_context = ssl._create_unverified_contextfeed = (feedparser.parse("https://www.tagesschau.de/xml/rss2"))print(feedparser.parse("https://www.tagesschau.de/xml/rss2"))feed_entries = feed.entriesfor entry in feed.entries:    article_title = entry["title"],    #article_link = entry["link"]    #print(f"{article_title}")    #print(f"{article_link}")doc_ref = db.collection(u'Tagesschau').document(u'Test')doc_ref.set({    u'tile': 'article_title'})

Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>