Created
April 21, 2019 11:50
-
-
Save PiotrKrosniak/d1288ed71029f0acfa7b142162121598 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Read list of RSS feeds from CSV files and save outpoot in another CSV | |
| import feedparser | |
| import csv | |
| import jsonpickle | |
| writer = csv.writer(open('items.csv', 'w')) | |
| reader = csv.reader(open('feeds.csv', 'r')) | |
| next(reader) # column headings | |
| for row in reader: | |
| url = row[0] | |
| print url | |
| feed = feedparser.parse(url) | |
| for entry in feed.entries: | |
| row[0] = jsonpickle.encode(entry) | |
| writer.writerow(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment