Source code for pyrsslocal.helper.subscription_helper

"""
Various functions about subscriptions


:githublink:`%|py|5`
"""

_example_subscriptions = """
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<body>

<outline text="XD Blog"
     title="XD Blog"
     type="rss"
     xmlUrl="http://www.xavierdupre.fr/blog/xdbrss.xml"
     htmlUrl="http://www.xavierdupre.fr/blog/xd_blog.html" />

</body>
</opml>
"""


[docs]def write_subscriptions_example(filename=None): """ returns an example of a subscriptions file :param filename: if not None, saves the string in that file :return: example :githublink:`%|py|28` """ if filename is not None: with open(filename, "w", encoding="utf8") as f: f.write(_example_subscriptions) return _example_subscriptions