Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • osian/sucs-site
  • kais58/sucs-site
  • imranh/sucs-site
  • foshjedi2004/sucs-site
  • gigosaurus/sucs-site
  • matstn/sucs-site
  • ripp_/sucs-site
  • eggnog/sucs-site
  • sucssite/sucs-site
  • elbows/sucs-site
  • realitykiller/sucs-site
  • crox/sucs-site
  • vectre/sucs-site
  • welshbyte/sucs-site
  • paperclipman/sucs-site
15 results
Show changes
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="docs.js"></script>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<title>Venus Documentation</title>
</head>
<body>
<h2>Table of Contents</h2>
<ul class="outer">
<li><a href="installation.html">Getting started</a></li>
<li>Basic Features
<ul>
<li><a href="config.html">Configuration</a></li>
<li><a href="templates.html">Templates</a></li>
</ul>
</li>
<li>Advanced Features
<ul>
<li><a href="venus.svg">Architecture</a></li>
<li><a href="normalization.html">Normalization</a></li>
<li><a href="filters.html">Filters and Plugins</a></li>
</ul>
</li>
<li>Other
<ul>
<li><a href="migration.html">Migration from Planet 2.0</a></li>
<li><a href="contributing.html">Contributing</a></li>
<li><a href="etiquette.html">Etiquette</a></li>
</ul>
</li>
<li>Reference
<ul>
<li><a href="http://www.planetplanet.org/">Planet</a></li>
<li><a href="http://feedparser.org/docs/">Universal Feed Parser</a></li>
<li><a href="http://code.google.com/p/html5lib/">html5lib</a></li>
<li><a href="http://htmltmpl.sourceforge.net/">htmltmpl</a></li>
<li><a href="http://bitworking.org/projects/httplib2/">httplib2</a></li>
<li><a href="http://www.w3.org/TR/xslt">XSLT</a></li>
<li><a href="http://www.gnu.org/software/sed/manual/html_mono/sed.html">sed</a></li>
<li><a href="http://www.djangoproject.com/documentation/templates/">Django templates</a></li>
</ul>
</li>
<li>Credits and License
<ul>
<li><a href="../AUTHORS">Authors</a></li>
<li><a href="../THANKS">Contributors</a></li>
<li><a href="../LICENCE">License</a></li>
</ul>
</li>
</ul>
</body>
</html>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="docs.js"></script>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<title>Venus Installation</title>
</head>
<body>
<h2>Installation</h2>
<p>Venus has been tested on Linux, and Mac OSX, and Windows.</p>
<p>You'll need at least Python 2.2 installed on your system, we recommend
Python 2.4 though as there may be bugs with the earlier libraries.</p>
<p>Everything Pythonesque Planet needs to provide basic operation should be
included in the distribution. Some optional features may require
additional libraries, for example:</p>
<ul>
<li>Usage of XSLT requires either
<a href="http://xmlsoft.org/XSLT/xsltproc2.html">xsltproc</a>
or <a href="http://xmlsoft.org/XSLT/python.html">python-libxslt</a>.</li>
<li>The current interface to filters written in non-templating languages
(e.g., python) uses the
<a href="http://docs.python.org/lib/module-subprocess.html">subprocess</a>
module which was introduced in Python 2.4.</li>
<li>Usage of FOAF as a reading list requires
<a href="http://librdf.org/">librdf</a>.</li>
</ul>
<h3>General Instructions</h3>
<p>
These instructions apply to any platform. Check the instructions
below for more specific instructions for your platform.
</p>
<ol>
<li><p>If you are reading this online, you will need to
<a href="../index.html">download</a> and extract the files into a folder somewhere.
You can place this wherever you like, <code>~/planet</code>
and <code>~/venus</code> are good
choices, but so's anywhere else you prefer.</p></li>
<li><p>This is very important: from within that directory, type the following
command:</p>
<blockquote><code>python runtests.py</code></blockquote>
<p>This should take anywhere from a one to ten seconds to execute. No network
connection is required, and the script cleans up after itself. If the
script completes with an "OK", you are good to go. Otherwise stopping here
and inquiring on the
<a href="http://lists.planetplanet.org/mailman/listinfo/devel">mailing list</a>
is a good idea as it can save you lots of frustration down the road.</p></li>
<li><p>Make a copy of one of the <code>ini</code> the files in the
<a href="../examples">examples</a> subdirectory,
and put it wherever you like; I like to use the Planet's name (so
<code>~/planet/debian</code>), but it's really up to you.</p></li>
<li><p>Edit the <code>config.ini</code> file in this directory to taste,
it's pretty well documented so you shouldn't have any problems here. Pay
particular attention to the <code>output_dir</code> option, which should be
readable by your web server. If the directory you specify in your
<code>cache_dir</code> exists; make sure that it is empty.</p></li>
<li><p>Run it: <code>python planet.py pathto/config.ini</code></p>
<p>You'll want to add this to cron, make sure you run it from the
right directory.</p></li>
<li><p>(Optional)</p>
<p>Tell us about it! We'd love to link to you on planetplanet.org :-)</p></li>
<li><p>(Optional)</p>
<p>Build your own themes, templates, or filters! And share!</p></li>
</ol>
<h3 id="macosx">Mac OS X and Fink Instructions</h3>
<p>
The <a href="http://fink.sourceforge.net/">Fink Project</a> packages
various open source software for MacOS. This makes it a little easier
to get started with projects like Planet Venus.
</p>
<p>
Note: in the following, we recommend explicitly
using <code>python2.4</code>. As of this writing, Fink is starting to
support <code>python2.5</code> but the XML libraries, for example, are
not yet ported to the newer python so Venus will be less featureful.
</p>
<ol>
<li><p>Install the XCode development tools from your Mac OS X install
disks</p></li>
<li><p><a href="http://fink.sourceforge.net/download/">Download</a>
and install Fink</p></li>
<li><p>Tell fink to install the Planet Venus prerequisites:<br />
<code>fink install python24 celementtree-py24 bzr-py24 libxslt-py24
libxml2-py24</code></p></li>
<li><p><a href="../index.html">Download</a> and extract the Venus files into a
folder somewhere</p></li>
<li><p>Run the tests: <code>python2.4 runtests.py</code><br /> This
will warn you that the RDF library is missing, but that's
OK.</p></li>
<li><p>Continue with the general steps above, starting with Step 3. You
may want to explicitly specify <code>python2.4</code>.</p></li>
</ol>
<h3 id="ubuntu">Ubuntu Linux (Edgy Eft) instructions</h3>
<p>Before starting, issue the following command:</p>
<blockquote><pre>sudo apt-get install bzr python2.4-librdf</pre></blockquote>
<h3 id="windows">Windows instructions</h3>
<p>
htmltmpl templates (and Django too, since it currently piggybacks on
the htmltmpl implementation) on Windows require
the <a href="http://sourceforge.net/projects/pywin32/">pywin32</a>
module.
</p>
<h3 id="python22">Python 2.2 instructions</h3>
<p>If you are running Python 2.2, you may also need to install <a href="http://pyxml.sourceforge.net/">pyxml</a>. If the
following runs without error, you do <b>not</b> have the problem.</p>
<blockquote><pre>python -c "__import__('xml.dom.minidom').dom.minidom.parseString('&lt;entry xml:lang=\"en\"/&gt;')"</pre></blockquote>
<p>Installation of pyxml varies by platform. For Ubuntu Linux (Dapper Drake), issue the following command:</p>
<blockquote><pre>sudo apt-get install python2.2-xml</pre></blockquote>
</body>
</html>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="docs.js"></script>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<title>Venus Migration</title>
</head>
<body>
<h2>Migration from Planet 2.0</h2>
<p>The intent is that existing Planet 2.0 users should be able to reuse
their existing <code>config.ini</code> and <code>.tmpl</code> files,
but the reality is that users will need to be aware of the following:</p>
<ul>
<li>You will need to start over with a new cache directory as the format
of the cache has changed dramatically.</li>
<li>Existing <code>.tmpl</code> and <code>.ini</code> files should work,
though some <a href="config.html">configuration</a> options (e.g.,
<code>days_per_page</code>) have not yet been implemented</li>
<li>No testing has been done on Python 2.1, and it is presumed not to work.</li>
<li>To take advantage of all features, you should install the optional
XML and RDF libraries described on
the <a href="installation.html">Installation</a> page.</li>
</ul>
<p>
Common changes to config.ini include:
</p>
<ul>
<li><p>Filename changes:</p>
<pre>
examples/fancy/index.html.tmpl => themes/classic_fancy/index.html.tmpl
examples/atom.xml.tmpl => themes/common/atom.xml.xslt
examples/rss20.xml.tmpl => themes/common/rss20.xml.tmpl
examples/rss10.xml.tmpl => themes/common/rss10.xml.tmpl
examples/opml.xml.tmpl => themes/common/opml.xml.xslt
examples/foafroll.xml.tmpl => themes/common/foafroll.xml.xslt
</pre></li>
</ul>
</body>
</html>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="docs.js"></script>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<title>Venus Normalization</title>
</head>
<body>
<h2>Normalization</h2>
<p>Venus builds on, and extends, the <a
href="http://www.feedparser.org/">Universal Feed Parser</a> and <a
href="http://code.google.com/p/html5lib/">html5lib</a> to
convert all feeds into Atom 1.0, with well formed XHTML, and encoded as UTF-8,
meaning that you don't have to worry about funky feeds, tag soup, or character
encoding.</p>
<h3>Encoding</h3>
<p>Input data in feeds may be encoded in a variety of formats, most commonly
ASCII, ISO-8859-1, WIN-1252, AND UTF-8. Additionally, many feeds make use of
the wide range of
<a href="http://www.w3.org/TR/html401/sgml/entities.html">character entity
references</a> provided by HTML. Each is converted to UTF-8, an encoding
which is a proper superset of ASCII, supports the entire range of Unicode
characters, and is one of
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">only two</a>
encodings required to be supported by all conformant XML processors.</p>
<p>Encoding problems are one of the more common feed errors, and every
attempt is made to correct common errors, such as the inclusion of
the so-called
<a href="http://www.fourmilab.ch/webtools/demoroniser/">moronic</a> versions
of smart-quotes. In rare cases where individual characters can not be
converted to valid UTF-8 or into
<a href="http://www.w3.org/TR/xml/#charsets">characters allowed in XML 1.0
documents</a>, such characters will be replaced with the Unicode
<a href="http://www.fileformat.info/info/unicode/char/fffd/index.htm">Replacement character</a>, with a title that describes the original character whenever possible.</p>
<p>In order to support the widest range of inputs, use of Python 2.3 or later,
as well as the installation of the python <code>iconvcodec</code>, is
recommended.</p>
<h3>HTML</h3>
<p>A number of different normalizations of HTML are performed. For starters,
the HTML is
<a href="http://www.feedparser.org/docs/html-sanitization.html">sanitized</a>,
meaning that HTML tags and attributes that could introduce javascript or
other security risks are removed.</p>
<p>Then,
<a href="http://www.feedparser.org/docs/resolving-relative-links.html">relative
links are resolved</a> within the HTML. This is also done for links
in other areas in the feed too.</p>
<p>Finally, unmatched tags are closed. This is done with a
<a href="http://code.google.com/p/html5lib/">knowledge of the semantics of HTML</a>. Additionally, a
<a href="http://golem.ph.utexas.edu/~distler/blog/archives/000165.html#sanitizespec">large
subset of MathML</a>, as well as a
<a href="http://www.w3.org/TR/SVGMobile/">tiny profile of SVG</a>
is also supported.</p>
<h3>Atom 1.0</h3>
<p>The Universal Feed Parser also
<a href="http://www.feedparser.org/docs/content-normalization.html">normalizes the content of feeds</a>. This involves a
<a href="http://www.feedparser.org/docs/reference.html">large number of elements</a>; the best place to start is to look at
<a href="http://www.feedparser.org/docs/annotated-examples.html">annotated examples</a>. Among other things a wide variety of
<a href="http://www.feedparser.org/docs/date-parsing.html">date formats</a>
are converted into
<a href="http://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a> formatted dates.</p>
<p>If no <a href="http://www.feedparser.org/docs/reference-entry-id.html">ids</a> are found in entries, attempts are made to synthesize one using (in order):</p>
<ul>
<li><a href="http://www.feedparser.org/docs/reference-entry-link.html">link</a></li>
<li><a href="http://www.feedparser.org/docs/reference-entry-title.html">title</a></li>
<li><a href="http://www.feedparser.org/docs/reference-entry-summary.html">summary</a></li>
<li><a href="http://www.feedparser.org/docs/reference-entry-content.html">content</a></li>
</ul>
<p>If no <a href="http://www.feedparser.org/docs/reference-feed-
updated.html">updated</a> dates are found in an entry, the updated date from
the feed is used. If no updated date is found in either the feed or
the entry, the current time is substituted.</p>
<h3 id="overrides">Overrides</h3>
<p>All of the above describes what Venus does automatically, either directly
or through its dependencies. There are a number of errors which can not
be corrected automatically, and for these, there are configuration parameters
that can be used to help.</p>
<ul>
<li><code>ignore_in_feed</code> allows you to list any number of elements
or attributes which are to be ignored in feeds. This is often handy in the
case of feeds where the <code>author</code>, <code>id</code>,
<code>updated</code> or <code>xml:lang</code> values can't be trusted.</li>
<li><code>title_type</code>, <code>summary_type</code>,
<code>content_type</code> allow you to override the
<a href="http://www.feedparser.org/docs/reference-entry-title_detail.html#reference.entry.title_detail.type"><code>type</code></a>
attributes on these elements.</li>
<li><code>name_type</code> does something similar for
<a href="http://www.feedparser.org/docs/reference-entry-author_detail.html#reference.entry.author_detail.name">author names</a></li>
<li><code>future_dates</code> allows you to specify how to deal with dates which are in the future.
<ul style="margin:0">
<li><code>ignore_date</code> will cause the date to be ignored (and will therefore default to the time the entry was first seen) until the feed is updated and the time indicated is past, at which point the entry will be updated with the new date.</li>
<li><code>ignore_entry</code> will cause the entire entry containing the future date to be ignored until the date is past.</li>
<li>Anything else (i.e.. the default) will leave the date as is, causing the entries that contain these dates sort to the top of the planet until the time passes.</li>
</ul>
</li>
<li><code>xml_base</code> will adjust the <code>xml:base</code> values in effect for each of the text constructs in the feed (things like <code>title</code>, <code>summary</code>, and <code>content</code>). Other elements in the feed (most notably, <code>link</code> are not affected by this value.
<ul style="margin:0">
<li><code>feed_alternate</code> will replace the <code>xml:base</code> in effect with the value of the <code>alternate</code> <code>link</code> found either in the enclosed <code>source</code> or enclosing <code>feed</code> element.</li>
<li><code>entry_alternate</code> will replace the <code>xml:base</code> in effect with the value of the <code>alternate</code> <code>link</code> found in this entry.</li>
<li>Any other value will be treated as a <a href="http://www.ietf.org/rfc/rfc3986.txt">URI reference</a>. These values may be relative or absolute. If relative, the <code>xml:base</code> values in each text construct will each be adjusted separately using to the specified value.</li>
</ul>
</li>
</ul>
</body>
</html>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="docs.js"></script>
<link rel="stylesheet" type="text/css" href="docs.css"/>
<title>Venus Templates</title>
</head>
<body>
<h2>Templates</h2>
<p>Template names take the form
<em>name</em><code>.</code><em>ext</em><code>.</code><em>type</em>, where
<em>name</em><code>.</code><em>ext</em> identifies the name of the output file
to be created in the <code>output_directory</code>, and <em>type</em>
indicates which language processor to use for the template.</p>
<p>Like with <a href="filter.html">filters</a>, templates may be written
in a variety of languages and are based on the standard Unix pipe convention
of producing <code>stdout</code> from <code>stdin</code>, but in practice
two languages are used more than others:</p>
<h3>htmltmpl</h3>
<p>Many find <a href="http://htmltmpl.sourceforge.net/">htmltmpl</a>
easier to get started with as you can take a simple example of your
output file, sprinkle in a few <code>&lt;TMPL_VAR&gt;</code>s and
<code>&lt;TMPL_LOOP&gt;</code>s and you are done. Eventually, however,
you may find that your template involves <code>&lt;TMPL_IF&gt;</code>
blocks inside of attribute values, and you may find the result difficult
to read and create correctly.</p>
<p>It is also important to note that htmltmpl based templates do not
have access to the full set of information available in the feed, just
the following (rather substantial) subset:</p>
<blockquote>
<table border="1" cellpadding="5" cellspacing="0">
<tr><th>VAR</th><th>type</th><th>source</th></tr>
<tr><td>author</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-author.html">author</a></td></tr>
<tr><td>author_name</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-author_detail.html#reference.feed.author_detail.name">author_detail.name</a></td></tr>
<tr><td>generator</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-generator.html">generator</a></td></tr>
<tr><td>id</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-id.html">id</a></td></tr>
<tr><td>icon</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-icon.html">icon</a></td></tr>
<tr><td>last_updated_822</td><td>Rfc822</td><td><a href="http://feedparser.org/docs/reference-feed-icon.html">updated_parsed</a></td></tr>
<tr><td>last_updated_iso</td><td>Rfc3399</td><td><a href="http://feedparser.org/docs/reference-feed-icon.html">updated_parsed</a></td></tr>
<tr><td>last_updated</td><td>PlanetDate</td><td><a href="http://feedparser.org/docs/reference-feed-icon.html">updated_parsed</a></td></tr>
<tr><td>link</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-link.html">link</a></td></tr>
<tr><td>logo</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-logo.html">logo</a></td></tr>
<tr><td>rights</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-rights_detail.html#reference.feed.rights_detail.value">rights_detail.value</a></td></tr>
<tr><td>subtitle</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-subtitle_detail.html#reference.feed.subtitle_detail.value">subtitle_detail.value</a></td></tr>
<tr><td>title</td><td>String</td><td><a href="http://feedparser.org/docs/reference-feed-title_detail.html#reference.feed.title_detail.value">title_detail.value</a></td></tr>
<tr><td>title_plain</td><td>Plain</td><td><a href="http://feedparser.org/docs/reference-feed-title_detail.html#reference.feed.title_detail.value">title_detail.value</a></td></tr>
<tr><td rowspan="2">url</td><td rowspan="2">String</td><td><a href="http://feedparser.org/docs/reference-feed-links.html#reference.feed.links.href">links[rel='self'].href</a></td></tr>
<tr><td><a href="http://feedparser.org/docs/reference-headers.html">headers['location']</a></td></tr>
</table>
</blockquote>
<p>Note: when multiple sources are listed, the last one wins</p>
<p>In addition to these variables, Planet Venus makes available two
arrays, <code>Channels</code> and <code>Items</code>, with one entry
per subscription and per output entry respectively. The data values
within the <code>Channels</code> array exactly match the above list.
The data values within the <code>Items</code> array are as follows:</p>
<blockquote>
<table border="1" cellpadding="5" cellspacing="0">
<tr><th>VAR</th><th>type</th><th>source</th></tr>
<tr><td>author</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-author.html">author</a></td></tr>
<tr><td>author_email</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-author_detail.html#reference.entry.author_detail.email">author_detail.email</a></td></tr>
<tr><td>author_name</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-author_detail.html#reference.entry.author_detail.name">author_detail.name</a></td></tr>
<tr><td>author_uri</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-author_detail.html#reference.entry.author_detail.href">author_detail.href</a></td></tr>
<tr><td>content_language</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-content.html#reference.entry.content.language">content[0].language</a></td></tr>
<tr><td rowspan="2">content</td><td rowspan="2">String</td><td><a href="http://feedparser.org/docs/reference-entry-summary_detail.html#reference.entry.summary_detail.value">summary_detail.value</a></td></tr>
<tr><td><a href="http://feedparser.org/docs/reference-entry-content.html#reference.entry.content.value">content[0].value</a></td></tr>
<tr><td rowspan="2">date</td><td rowspan="2">PlanetDate</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
<tr><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td rowspan="2">date_822</td><td rowspan="2">Rfc822</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
<tr><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td rowspan="2">date_iso</td><td rowspan="2">Rfc3399</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
<tr><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td><ins>enclosure_href</ins></td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-enclosures.html#reference.entry.enclosures.href">enclosures[0].href</a></td></tr>
<tr><td><ins>enclosure_length</ins></td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-enclosures.html#reference.entry.enclosures.length">enclosures[0].length</a></td></tr>
<tr><td><ins>enclosure_type</ins></td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-enclosures.html#reference.entry.enclosures.type">enclosures[0].type</a></td></tr>
<tr><td><ins>guid_isPermaLink</ins></td><td>String</td><td><a href="http://blogs.law.harvard.edu/tech/rss#ltguidgtSubelementOfLtitemgt">isPermaLink</a></td></tr>
<tr><td>id</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-id.html">id</a></td></tr>
<tr><td>link</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-links.html#reference.entry.links.href">links[rel='alternate'].href</a></td></tr>
<tr><td>new_channel</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-id.html">id</a></td></tr>
<tr><td rowspan="2">new_date</td><td rowspan="2">NewDate</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
<tr><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td>rights</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-rights_detail.html#reference.entry.rights_detail.value">rights_detail.value</a></td></tr>
<tr><td>title_language</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-title_detail.html#reference.entry.title_detail.language">title_detail.language</a></td></tr>
<tr><td>title_plain</td><td>Plain</td><td><a href="http://feedparser.org/docs/reference-entry-title_detail.html#reference.entry.title_detail.value">title_detail.value</a></td></tr>
<tr><td>title</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-title_detail.html#reference.entry.title_detail.value">title_detail.value</a></td></tr>
<tr><td>summary_language</td><td>String</td><td><a href="http://feedparser.org/docs/reference-entry-summary_detail.html#reference.entry.summary_detail.language">summary_detail.language</a></td></tr>
<tr><td>updated</td><td>PlanetDate</td><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td>updated_822</td><td>Rfc822</td><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td>updated_iso</td><td>Rfc3399</td><td><a href="http://feedparser.org/docs/reference-entry-updated_parsed.html">updated_parsed</a></td></tr>
<tr><td>published</td><td>PlanetDate</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
<tr><td>published_822</td><td>Rfc822</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
<tr><td>published_iso</td><td>Rfc3399</td><td><a href="http://feedparser.org/docs/reference-entry-published_parsed.html">published_parsed</a></td></tr>
</table>
</blockquote>
<p>Note: variables above which start with
<code>new_</code> are only set if their values differ from the previous
Item.</p>
<h3>django</h3>
<p>
If you have the <a href="http://www.djangoproject.com/">Django</a>
framework installed,
<a href="http://www.djangoproject.com/documentation/templates/"
>Django templates</a> are automatically available to Venus
projects. You will have to save them with a <code>.html.dj</code>
extension in your themes. The variable set is the same as the one
from htmltmpl, above. In the Django template context you'll have
access to <code>Channels</code> and <code>Items</code> and you'll be
able to iterate through them.
</p>
<p>
You also have access to the <code>Config</code> dictionary, which contains
the Venus configuration variables from your <code>.ini</code> file.
</p>
<p>
If you lose your way and want to introspect all the variable in the
context, there's the useful <code>{% debug %}</code> template tag.
</p>
<p>
In the <code>themes/django/</code> you'll find a sample Venus theme
that uses the Django templates that might be a starting point for
your own custom themes.
</p>
<p>
All the standard Django template tags and filter are supposed to
work, with the notable exception of the <code>date</code> filter on
the updated and published dates of an item (it works on the main
<code>{{ date }}</code> variable).
</p>
<p>
Please note that Django, and therefore Venus' Django support,
requires at least Python 2.3.
</p>
<h3>xslt</h3>
<p><a href="http://www.w3.org/TR/xslt">XSLT</a> is a paradox: it actually
makes some simple things easier to do than htmltmpl, and certainly can
make more difficult things possible; but it is fair to say that many
find XSLT less approachable than htmltmpl.</p>
<p>But in any case, the XSLT support is easier to document as the
input is a <a href="normalization.html">highly normalized</a> feed,
with a few extension elements.</p>
<ul>
<li><code>atom:feed</code> will have the following child elements:
<ul>
<li>A <code>planet:source</code> element per subscription, with the same child elements as <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php#element.source"><code>atom:source</code></a>, as well as
an additional child element in the planet namespace for each
<a href="config.html#subscription">configuration parameter</a> that applies to
this subscription.</li>
<li><a href="http://www.feedparser.org/docs/reference-version.html"><code>planet:format</code></a> indicating the format and version of the source feed.</li>
<li><a href="http://www.feedparser.org/docs/reference-bozo.html"><code>planet:bozo</code></a> which is either <code>true</code> or <code>false</code>.</li>
</ul>
</li>
<li><code>atom:updated</code> and <code>atom:published</code> will have
a <code>planet:format</code> attribute containing the referenced date
formatted according to the <code>[planet] date_format</code> specified
in the configuration</li>
</ul>
<h3>genshi</h3>
<p>Genshi approaches the power of XSLT, but with a syntax that many Python
programmers find more natural, succinct and expressive. Genshi templates
have access to the full range of <a href="http://feedparser.org/docs/reference.html">feedparser</a> values, with the following additions:</p>
<ul>
<li>In addition to a <code>feed</code> element which describes the feed
for your planet, there is also a <code>feeds</code> element which contains
the description for each subscription.</li>
<li>All <code>feed</code>, <code>feeds</code>, and <code>source</code> elements have a child <code>config</code> element which contains the config.ini entries associated with that feed.</li>
<li>All text construct detail elements (<code>subtitle</code>, <code>rights</code>, <code>title</code>, <code>summary</code>, <code>content</code>) also contain a <code>stream</code> element which contains the value as a Genshi stream.</li>
<li>Each of the <code>entries</code> has a <code>new_date</code> and <code>new_feed</code> value which indicates if this entry's date or feed differs from the preceeding entry.</li>
</ul>
</body>
</html>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 1024" xmlns:xlink="http://www.w3.org/1999/xlink">>
<defs>
<g id="feed">
<path d="M10,15l75,0l0,75l-75,0z" fill="#F80"
stroke-linejoin="round" stroke-width="20" stroke="#F80"/>
<circle cx="15" cy="82" r="6" fill="#FFF"/>
<path d="M35,82s0-20-20-20 M55,82s0-40-40-40 M75,82s0-60-60-60"
stroke-linecap="round" stroke-width="12" stroke="#FFF" fill="none"/>
</g>
<g id="entry">
<g fill="none">
<ellipse stroke="#689" rx="3" ry="22"/>
<ellipse stroke="#eb4" rx="3" ry="22" transform="rotate(-66)"/>
<ellipse stroke="#8ac" rx="3" ry="22" transform="rotate(66)"/>
<circle stroke="#451" r="22"/>
</g>
<g fill="#689" stroke="#FFF">
<circle fill="#8ac" r="6.5"/>
<circle cy="-22" r="4.5"/>
<circle cx="-20" cy="9" r="4.5"/>
<circle cx="20" cy="9" r="4.5"/>
</g>
</g>
<g id="node" stroke="none">
<circle r="18" fill="#049"/>
<path d="M-14,7a16,16,0,0,1,22-21a15,15,0,0,0-14,2a3,3,0,1,1-5,5
a15,15,0,0,0-3,14" fill="#FFF"/>
</g>
<path d="M-14-6a44,62,0,0,0,28,0l0,12a44,62,0,0,0-28,0z"
fill="#049" id="arc"/>
</defs>
<rect height="1024" width="1280" fill="#0D0"/>
<use xlink:href="#feed" x="220" y="30"/>
<use xlink:href="#feed" x="150" y="60"/>
<use xlink:href="#feed" x="100" y="100"/>
<use xlink:href="#feed" x="60" y="150"/>
<use xlink:href="#feed" x="30" y="220"/>
<g fill="#F00" stroke-linejoin="round" stroke-width="12" stroke="#F88">
<path d="M50,800l0,180l1000,0l0-180z" fill="#FFF"/>
<path d="M150,330l400,0l0,300l-400,0z"/>
<path d="M750,200l200,0 l0,110l100,0l0,60l-100,0 l0,40l100,0l0,60l-100,0
l0,40l100,0l0,60l-100,0 l0,130l70,70l-340,0l70,-70z"/>
</g>
<path d="M1080,360l100,0l0,-70l-30,-30l-70,0z" fill="#FFF"/>
<path d="M1180,290l-30,0l0,-30" fill="none" stroke="#000"/>
<use xlink:href="#feed" x="1080" y="380"/>
<g transform="translate(1080,500)">
<use xlink:href="#arc" transform="translate(76,50) rotate(90)"/>
<use xlink:href="#arc" transform="translate(50,35) rotate(-30)"/>
<use xlink:href="#arc" transform="translate(50,65) rotate(30)"/>
<use xlink:href="#node" transform="translate(24,50)"/>
<use xlink:href="#node" transform="translate(76,80)"/>
<use xlink:href="#node" transform="translate(76,20)"/>
</g>
<path d="M260,150s100,60,90,280 M170,270s150,0,180,120
M200,200s150,0,150,200l0,450m-100,-70l100,70l100,-70
M850,807l0,-200m-70,70l70,-70l70,70"
stroke="#000" fill="none" stroke-width="40"/>
<ellipse cx="350" cy="368" fill="#FFF" rx="80" ry="30"/>
<ellipse cx="850" cy="238" fill="#FFF" rx="80" ry="30"/>
<g font-size="32" fill="#FFF" text-anchor="middle">
<text x="350" y="380" fill="#F00">Spider</text>
<text x="350" y="460">Universal Feed Parser</text>
<text x="350" y="530">html5lib</text>
<text x="350" y="600">Reconstitute</text>
<text x="350" y="750">Filter(s)</text>
<text x="850" y="250" fill="#F00">Splice</text>
<text x="950" y="350">Template</text>
<text x="950" y="450">Template</text>
<text x="950" y="550">Template</text>
<text x="1126" y="330" fill="#000">HTML</text>
</g>
<use xlink:href="#entry" x="100" y="900"/>
<use xlink:href="#entry" x="180" y="950"/>
<use xlink:href="#entry" x="200" y="850"/>
<use xlink:href="#entry" x="290" y="920"/>
<use xlink:href="#entry" x="400" y="900"/>
<use xlink:href="#entry" x="470" y="840"/>
<use xlink:href="#entry" x="500" y="930"/>
<use xlink:href="#entry" x="570" y="870"/>
<use xlink:href="#entry" x="620" y="935"/>
<use xlink:href="#entry" x="650" y="835"/>
<use xlink:href="#entry" x="690" y="900"/>
<use xlink:href="#entry" x="720" y="835"/>
<use xlink:href="#entry" x="730" y="950"/>
<use xlink:href="#entry" x="760" y="900"/>
<use xlink:href="#entry" x="790" y="835"/>
<use xlink:href="#entry" x="800" y="950"/>
<use xlink:href="#entry" x="830" y="900"/>
<use xlink:href="#entry" x="860" y="835"/>
<use xlink:href="#entry" x="870" y="950"/>
<use xlink:href="#entry" x="900" y="900"/>
<use xlink:href="#entry" x="930" y="835"/>
<use xlink:href="#entry" x="940" y="950"/>
<use xlink:href="#entry" x="970" y="900"/>
<use xlink:href="#entry" x="1000" y="835"/>
<use xlink:href="#entry" x="1010" y="950"/>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY categoryTerm "WebSemantique">
]>
<!--
This transformation is released under the same licence as Python
see http://www.intertwingly.net/code/venus/LICENCE.
Author: Eric van der Vlist <vdv@dyomedea.com>
This transformation is meant to be used as a filter that determines if
Atom entries are relevant to a specific topic and adds the corresonding
<category/> element when it is the case.
This is done by a simple keyword matching mechanism.
To customize this filter to your needs:
1) Replace WebSemantique by your own category name in the definition of
the categoryTerm entity above.
2) Review the "upper" and "lower" variables that are used to convert text
nodes to lower case and replace common ponctuation signs into spaces
to check that they meet your needs.
3) Define your own list of keywords in <d:keyword/> elements. Note that
the leading and trailing spaces are significant: "> rdf <" will match rdf
as en entier word while ">rdf<" would match the substring "rdf" and
"> rdf<" would match words starting by rdf. Also note that the test is done
after conversion to lowercase.
To use it with venus, just add this filter to the list of filters, for instance:
filters= categories.xslt guess_language.py
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://ns.websemantique.org/data/" exclude-result-prefixes="d atom" version="1.0">
<xsl:variable name="upper"
>,.;AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖöØøÙùÚúÛûÜüÝýÞþ</xsl:variable>
<xsl:variable name="lower"
> aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaaaaaaaaaaaaææcceeeeeeeeiiiiiiiiððnnooooooooooøøuuuuuuuuyyþþ</xsl:variable>
<d:keywords>
<d:keyword> wiki semantique </d:keyword>
<d:keyword> wikis semantiques </d:keyword>
<d:keyword> web semantique </d:keyword>
<d:keyword> websemantique </d:keyword>
<d:keyword> semantic web</d:keyword>
<d:keyword> semweb</d:keyword>
<d:keyword> rdf</d:keyword>
<d:keyword> owl </d:keyword>
<d:keyword> sparql </d:keyword>
<d:keyword> topic map</d:keyword>
<d:keyword> doap </d:keyword>
<d:keyword> foaf </d:keyword>
<d:keyword> sioc </d:keyword>
<d:keyword> ontology </d:keyword>
<d:keyword> ontologie</d:keyword>
<d:keyword> dublin core </d:keyword>
</d:keywords>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="atom:entry/atom:updated">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xsl:variable name="concatenatedText">
<xsl:for-each select="../atom:title|../atom:summary|../atom:content|../atom:category/@term">
<xsl:text> </xsl:text>
<xsl:value-of select="translate(., $upper, $lower)"/>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:variable>
<xsl:if test="document('')/*/d:keywords/d:keyword[contains($concatenatedText, .)]">
<category term="WebSemantique"/>
</xsl:if>
</xsl:template>
<xsl:template match="atom:category[@term='&categoryTerm;']"/>
</xsl:stylesheet>
This filter is released under the same licence as Python
see http://www.intertwingly.net/code/venus/LICENCE.
Author: Eric van der Vlist <vdv@dyomedea.com>
This filter guesses whether an Atom entry is written
in English or French. It should be trivial to chose between
two other languages, easy to extend to more than two languages
and useful to pass these languages as Venus configuration
parameters.
The code used to guess the language is the one that has been
described by Douglas Bagnall as the Python recipe titled
"Language detection using character trigrams"
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/326576.
To add support for a new language, this language must first be
"learned" using learn-language.py. This learning phase is nothing
more than saving a pickled version of the Trigram object for this
language.
To learn Finnish, you would execute:
$ ./learn-language.py http://gutenberg.net/dirs/1/0/4/9/10492/10492-8.txt fi.data
where http://gutenberg.net/dirs/1/0/4/9/10492/10492-8.txt is a text
representative of the Finnish language and "fi.data" is the name of the
data file for "fi" (ISO code for Finnish).
To install this filter, copy this directory under the Venus
filter directory and declare it in your filters list, for instance:
filters= categories.xslt guess-language/guess-language.py
NOTE: this filter depends on Amara
(http://uche.ogbuji.net/tech/4suite/amara/)