Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
README updates, RSS escaping, fixes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
thomersch committed May 2, 2016
1 parent d76e65b commit 5c5f9b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion LICENSE
@@ -1,7 +1,6 @@
BSD 2-Clause License

Copyright (c) 2013-2016, Thomas Skowron and others
(https://github.com/thomersch/Mikrowelle-OS/graphs/contributors)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -107,15 +107,13 @@ The file name doesn't really matter, but your episode order will depend on it.
## Templating
### Changing the looks of your podcast page.

You can customize your templates at any time. Simply go to the template folder and edit the files. Variables should be rather self explainatory. A working example for a template is located [there](https://github.com/thomersch/mikrowelle-template).

If you want to start a new style, I recommend to duplicate the `templates/base-template` folder and start editing in the duplicate. Remember to change the `tplfolder` path in `settings.json`.

Adding a stylesheet is nice as well, give it a try. The directory `res` in the template path will be linked in the pub-path, so you can place all your assets in `$templatename/res` and those will be available at `res` on your main publishing path, e.g. `podcast.example.com/res`.

## Feature requests

Give 'em to me. Create a ticket or contact me.
Give 'em to me. Create a GitHub issue or contact me.

## Other Questions?

Expand All @@ -124,3 +122,9 @@ Ask me.
## License

BSD License. No bullshit. See `LICENSE` file.

## Contributors

* Thomas Skowron
* Thomas Sänger (HorayNarea)
* Andreas Hubel (saerdnaer)
19 changes: 7 additions & 12 deletions util/rssgen.py
Expand Up @@ -22,11 +22,6 @@ def _chapters(element, namespaces):
return xml_chapters


def _encode(s):
s = s.replace("&", "&")
return s


def generate(channel, elements, settings):
namespaces = {
"itunes": "http://www.itunes.com/dtds/podcast-1.0.dtd",
Expand All @@ -41,16 +36,16 @@ def generate(channel, elements, settings):
fe = {}

fe["title"] = etree.Element("title")
fe["title"].text = _encode(channel["title"])
fe["title"].text = channel["title"]

fe["link"] = etree.Element("link")
fe["link"].text = _encode(channel["link"])
fe["link"].text = channel["link"]

fe["ttl"] = etree.Element("ttl")
fe["ttl"].text = channel["feedinterval"]

fe["description"] = etree.Element("description")
fe["description"].text = _encode(channel["description"])
fe["description"].text = channel["description"]

fe["lastBuildDate"] = etree.Element("lastBuildDate")
fe["lastBuildDate"].text = datetime.now().strftime("%a, %d %b %Y %H:%M:%S +0000")
Expand All @@ -59,22 +54,22 @@ def generate(channel, elements, settings):
fe["generator"].text = "Mikrowelle OS"

fe["author"] = etree.Element("author")
fe["author"].text = _encode(channel["author"])
fe["author"].text = channel["author"]

fe["it_author"] = etree.Element("{%s}author" % namespaces["itunes"])
fe["it_author"].text = _encode(channel["author"])
fe["it_author"].text = channel["author"]

fe["language"] = etree.Element("language")
fe["language"].text = settings.get("language", "de-de")

cat = _encode(settings.get("category", None))
cat = settings.get("category", None)
if isinstance(cat, str) or isinstance(cat, unicode):
fe["it_category"] = etree.Element("{%s}category" % namespaces["itunes"], text=cat)

if "artwork" in channel:
fe["it_logo"] = etree.Element("{%s}image" % namespaces["itunes"], href=channel["artwork"])
fe["logo"] = etree.Element("logo")
fe["logo"].text = _encode(channel["artwork"])
fe["logo"].text = channel["artwork"]

if "explicit" in channel:
fe["explicit"] = etree.Element("{%s}explicit" % namespaces["itunes"])
Expand Down

0 comments on commit 5c5f9b7

Please sign in to comment.