lkiesow / python-feedgen

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

WebSub Support? #122

Closed iexpertini closed 1 year ago

iexpertini commented 1 year ago

Hi there,

Thanks for such a nice feedgen. Actually we are trying to add the link for WebSub fg.link(rel='hub', href="https://pubsubhubbub.appspot.com/") but this seems only adding as https://pubsubhubbub.appspot.com/

Appreciated if you can guide for this.

Regards,

iexpertini commented 1 year ago

Any Luck on this?

iexpertini commented 1 year ago

For those who are looking for this solution.

The work around is to Follow this steps:

A) Go to Module folder of feedgen >> feed.py file

At line279 add:

        if ln.get('rel') == 'hub':
            selflink = xml_elem('{http://www.w3.org/2005/Atom}link',
                                channel, href=ln['href'], rel='hub') 

Save and Exit B) And declare in your feed file: fg.link(href="https://pubsubhubbub.appspot.com/", rel='hub' )

Run Your feed file within in the output you fill find the line added within channel as we needed:

    <atom:link href="https://pubsubhubbub.appspot.com/" rel="hub"/>

Thanks, Ahsan