getpelican / feedgenerator Goto Github PK
View Code? Open in Web Editor NEWStandalone version of Django's feedgenerator module
License: BSD 3-Clause "New" or "Revised" License
Standalone version of Django's feedgenerator module
License: BSD 3-Clause "New" or "Revised" License
OPML support would be useful.
Adding custom attributes would be good too:
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
I was digging into why the feedgenerator tarball is 4.1MB and see that there were some issues and PRs about this a few years ago but there has not been a release to PyPI since then. Any chance?
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
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.
Should we add JSON Feed capability to FeedGenerator? @rjames86 has begun work on a JSON Feed plugin, and he wondered what @getpelican/reviewers thought about integrating it into FeedGenerator instead. Any thoughts?
OPML support would be useful.
Adding custom attributes would be good too:
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
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
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.
Function add_item
.
Graphics would make feeds more appealing and easier to visually identify.
Generator would be good to refer to a syndication project which utilizes feedgenerator.
Hiya,
I was building the package for Fedora using the source from pip. I noticed the .tox
directory is included in the tar there - is this necessary?
Could the pip tarball please include the LICENSE file that's here in the git repository?
description
is a required parameter for Atom1Feed
but it is not used anywhere. I think there's two possible solutions:
Atom1Feed
subtitle
element for the description
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
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>
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.
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
I pasted my source to https://validator.w3.org/feed/#validate_by_input → Validate
.
All symbols are ASCII:
<id>tag:kristinita.netlify.app,2018-04-05:/Kira-Goddess.html</id>
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>
Cyrillic symbols:
<id>tag:kristinita.netlify.app,2018-04-05:/Кира-Богиня.html</id>
Any non-ASCII characters:
<id>tag:kristinita.netlify.app,2018-04-05:/Kira-…-Goddess.html</id>
Thanks.
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.
currently there's a mix of various seemingly supported python versions in the repo:
.github/workflows/main.yml
: tests against py37..py39setup.py
claims: py27, py35..py38tox.ini
claims: py26, py27, py32..py35which versions do you want to support? i propose do drop python2 completely and remove make py36 the oldest supported version for now.
It seems that since FeedGenerator 1.9.2, some feeds are being rendered with empty <subtitle></subtitle>
tags in feeds.
Example: getpelican/pelican@99e7af4
Presumably this change in behavior was introduced in PR #23. Perhaps we should amend the conditional check to ensure that empty subtitle tags are not written to the feed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.