Skip to content

Instantly share code, notes, and snippets.

@PiotrKrosniak
Created April 21, 2019 11:50
Show Gist options
  • Select an option

  • Save PiotrKrosniak/d1288ed71029f0acfa7b142162121598 to your computer and use it in GitHub Desktop.

Select an option

Save PiotrKrosniak/d1288ed71029f0acfa7b142162121598 to your computer and use it in GitHub Desktop.
#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