Git Product home page Git Product logo

feedgenerator's People

Contributors

almet avatar avaris avatar botpub avatar cclauss avatar eevee avatar hugovk avatar ikalnytskyi avatar jorgesumle avatar justinmayer avatar mansam avatar mgorny avatar neirbowj avatar pseyfert avatar saimn avatar scheirle avatar softlysplinter avatar venthur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

feedgenerator's Issues

OPML support (and ability to add custom attributes)

OPML support would be useful.
Adding custom attributes would be good too:

  • Custom filter rules (See Liferea).
  • Custom tags (See Slixfeed).
def export_to_opml(jid, filename, results):
    print(jid, filename, results)
    function_name = sys._getframe().f_code.co_name
    logger.debug('{} jid: {} filename: {}'
                .format(function_name, jid, filename))
    root = ETR.Element("opml")
    root.set("version", "1.0")
    head = ETR.SubElement(root, "head")
    ETR.SubElement(head, "title").text = "{}".format(jid)
    ETR.SubElement(head, "description").text = (
        "Set of subscriptions exported by Slixfeed")
    ETR.SubElement(head, "generator").text = "Slixfeed"
    ETR.SubElement(head, "urlPublic").text = (
        "https://gitgud.io/sjehuda/slixfeed")
    time_stamp = dt.current_time()
    ETR.SubElement(head, "dateCreated").text = time_stamp
    ETR.SubElement(head, "dateModified").text = time_stamp
    body = ETR.SubElement(root, "body")
    for result in results:
        outline = ETR.SubElement(body, "outline")
        outline.set("text", result[1])
        outline.set("xmlUrl", result[2])
        # outline.set("type", result[2])
    tree = ETR.ElementTree(root)
    tree.write(filename)

https://gitgud.io/sjehuda/slixfeed/-/raw/master/slixfeed/action.py?ref_type=heads

The file unittest is non automatic and unnecessary

Currently unittest OFF_test_002_file_results is not implemented and must be executed manually.

This is really bad because such test are often overlooked (See my resent PR #4).

Also the corresponding expected output files (test.rss and test.atom) are currently in a strange place (root). Why are they not with the rest of the test files?
It took me quite some time to figure out why they even exist.
(Never thought there would be manual unit tests.)


I think the best solution is to simply remove OFF_test_002_file_results (and test.rss and test.atom) as it does not increase the coverage:
feed.write the method which gets tested is already covered by feed.writeString

no "updated" tags generated by feedgenerator 1.8

It seems that if feedgenerator 1.8 is used, there is no "updated" tag for each entry in atom feed. And because of this the feed is pushing always a lot of old posts to the reader. I tried pelican 3.6.3 and 3.6.4dev and it seems that both of them are pulling the 1.8 version of feedgenerator. The solution was to install first feedgenerator 1.6 and then install pelican.

OPML with custom attributes

OPML support would be useful.
Adding custom attributes would be good too:

  • Custom filter rules (See Liferea).
  • Custom tags (See Slixfeed).
def export_to_opml(jid, filename, results):
    print(jid, filename, results)
    function_name = sys._getframe().f_code.co_name
    logger.debug('{} jid: {} filename: {}'
                .format(function_name, jid, filename))
    root = ETR.Element("opml")
    root.set("version", "1.0")
    head = ETR.SubElement(root, "head")
    ETR.SubElement(head, "title").text = "{}".format(jid)
    ETR.SubElement(head, "description").text = (
        "Set of subscriptions exported by Slixfeed")
    ETR.SubElement(head, "generator").text = "Slixfeed"
    ETR.SubElement(head, "urlPublic").text = (
        "https://gitgud.io/sjehuda/slixfeed")
    time_stamp = dt.current_time()
    ETR.SubElement(head, "dateCreated").text = time_stamp
    ETR.SubElement(head, "dateModified").text = time_stamp
    body = ETR.SubElement(root, "body")
    for result in results:
        outline = ETR.SubElement(body, "outline")
        outline.set("text", result[1])
        outline.set("xmlUrl", result[2])
        # outline.set("type", result[2])
    tree = ETR.ElementTree(root)
    tree.write(filename)

https://gitgud.io/sjehuda/slixfeed/-/raw/master/slixfeed/action.py?ref_type=heads

setup.py fails with UnicodeDecodeError on FreeBSD 12.1-RELEASE-p6 under poudriere

When building the www/py-feedgenerator port in FreeBSD using the poudriere tool, the build fails in the "configure" phase with a UnicodeDecodeError traceback in setup.py. This affects multiple versions of Python 3.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 11, in <module>
    LONG_DESCRIPTION = open('README.rst').read()
  File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 422: ordinal not in range(128)
*** Error code 1

Analysis

setup.py populates the contents of the package's long_description parameter by opening and reading the README.rst file. The file appears to be UTF-8 encoded, but setup.py does not specify an encoding, which causes the open function to fall back to guessing the encoding based on the platform and environment. In this case, Python guesses ASCII. Since README.rst includes a RIGHT SINGLE QUOTATION MARK (U+2019) character that cannot be represented in ASCII, the decode fails.

More attributes (graphics and generator)

Function add_item.

Attributes of graphics:

Graphics would make feeds more appealing and easier to visually identify.

  • icon
  • image
  • logo

Attribute for generator:

Generator would be good to refer to a syndication project which utilizes feedgenerator.

  • generator

XSLT stylesheet

It would be highly beneficial to add an XSLT stylesheet to the project including a boolean option (default is True) to enable ot disable stylesheet.

For more information and stylesheet to test, please refer to https://gitgud.io/sjehuda/streamburner

feature_request(validation): Non-ASCII symbols in URI

1. Summary

If URI of my articles/pages contain Non-ASCII symbols, feedgenerator generate not valid feeds. Validation message:

Sorry

This feed does not validate.

    line 16, column 61: id is not a valid TAG: tag:kristinita.netlify.app,2018-04-05:/Кира-Богиня.html [help]

                <id>tag:kristinita.netlify.app,2018-04-05:/Кира-Богиня.html</id>

id is not valid tag

2. Possible solution

I think, it would be nice encode Non-ASCII symbols.

See W3C Feed Validation Service documentation for error I’m getting:

Ensure that the URI: (…)

Followed by any number of characters which are valid in a URI. Special characters may be escaped using percent encoding.

3. MCVE

Simply feed, generated by Pelican feedgenerator.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Kira Goddess</title>
    <link href="https://kristinita.netlify.app/" rel="alternate"/>
    <link href="https://kristinita.netlify.app/feeds/misc.atom.xml" rel="self"/>
    <id>https://kristinita.netlify.app/</id>
    <updated>2020-09-24T18:57:33+03:00</updated>
    <entry>
        <title>Kira Goddess</title>
        <link href="https://kristinita.netlify.app/kira-goddess.html" rel="alternate"/>
        <published>2020-09-24T18:57:33+03:00</published>
        <updated>2020-09-24T18:57:33+03:00</updated>
        <author>
            <name>Sasha Chernykh</name>
        </author>
        <id>tag:kristinita.netlify.app,2018-04-05:/Кира-Богиня.html</id>
        <content type="html">Kira Goddess!</content>
    </entry>
</feed>

In examples below I change content of bottom <id> tag

4. Steps to reproduce

I pasted my source to https://validator.w3.org/feed/#validate_by_inputValidate.

5. Behavior

5.1. Valid

  1. All symbols are ASCII:

    <id>tag:kristinita.netlify.app,2018-04-05:/Kira-Goddess.html</id>
  2. Percent-encoding URN:

    <id>tag:kristinita.netlify.app,2018-04-05:/%D0%9A%D0%B8%D1%80%D0%B0-%D0%91%D0%BE%D0%B3%D0%B8%D0%BD%D1%8F.html</id>

5.2. Not valid

  1. Cyrillic symbols:

    <id>tag:kristinita.netlify.app,2018-04-05:/Кира-Богиня.html</id>
  2. Any non-ASCII characters:

    <id>tag:kristinita.netlify.app,2018-04-05:/Kira-…-Goddess.html</id>

Thanks.

Support Mulitple Enclosures

The version of feedgenerator.py distributed with Django supports passing an array of 'enclosures' to add_item() instead of a single 'enclsoure'. (Multiple enclosures are only supported by Atom feeds.) Here is the PR that added the supporte for multiple enclosures (August 2015):

django/django@aac2a2d#diff-1d2005672da1027b84aaeb48fe105351

It would be nice if that could be brought over to this package.

which python versions do you want to support?

currently there's a mix of various seemingly supported python versions in the repo:

  • .github/workflows/main.yml: tests against py37..py39
  • setup.py claims: py27, py35..py38
  • tox.ini claims: py26, py27, py32..py35

which versions do you want to support? i propose do drop python2 completely and remove make py36 the oldest supported version for now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.