lkiesow / python-feedgen

Python module to generate ATOM feeds, RSS feeds and Podcasts.
https://feedgen.kiesow.be/
BSD 2-Clause "Simplified" License
726 stars 122 forks source link

Add entry to existing feed #32

Closed ajaygupta2790 closed 8 years ago

ajaygupta2790 commented 9 years ago

How do I perform following action fe = fg.add_entry() for existing feed XML file .

Say I created feed using the following code:

fg = FeedGenerator()
fg.id('http://lernfunk.de/media/654321')
fg.title('Some Testfeed')
fg.author({'name': 'John Doe', 'email': 'john@example.de'})
fg.link(href='http://example.com', rel='alternate')
fg.logo('http://ex.com/logo.jpg')
fg.subtitle('This is a cool feed!')
fg.link(href='http://larskiesow.de/test.atom', rel='self')
fg.language('en')
fe = fg.add_entry()
fe.id('http://lernfunk.de/media/654321/1')
fe.link(href='http://example.com', rel='alternate')
fe.title('The First Episode')
atomfeed = fg.atom_str(pretty=True)
fg.atom_file(feed_local_feed_filepath)

Now that I have saved a the XML file at a particular location, how to add more to this already present XML file?

lkiesow commented 8 years ago

At the moment, the purpose of feedgen is to generate a feed from existing data, not to parse and extend an existing feed, though since lxml is used as XML back-end, it would be possible to do that. Patches are welcome but I will not add that functionality. My suggestion in general would be to hold the data in a database and generate the feed from these data.

Bluscream commented 5 years ago

PLEASE ADD THIS ! I love you ♥

lkiesow commented 5 years ago

@Bluscream, citing myself:

Patches are welcome

😉