RSSReader

Description

This Macro will output the content of an RSS/ATOM Feed into a wikipage.

See example here:
attachment:RSSReader.png

Download & Release Notes

Download

Release Version

Moin Version

Release Notes

Author

RSSReader.py

2.2

1.9.61

new features

Marcel Häfner / Matthijs Kooijman

RSSReader-2.0.py

2.0

1.8 / 1.9

new version & new features

MarcelHäfner

RSSReader-1.py

1.0

1.5

IanWienand

Usage

Examples:

Description

<<RSSReader(feed, maxEntries, allowHtml, includeStyle, dateFormat, linkEntries>>

CSS

This following CSS will be automaticly inserted above the output of the rss feed, with  includeStyle = False  you can disable this style output and may use your own css.

    /* macro RSSReader start*/
    div.rssReader .rssHeader {
        margin-top: 1em;
        margin-bottom: 1em;
        border-bottom: 1px dotted gray;
    }
    div.rssReader .rssSubTitle, div.rssReader .rssDescription {
        font-size: bold;
    }
    div.rssReader div.rssEntries {
        margin-top: 1em;
        margin-bottom: 1em;
        border-bottom: 1px dotted gray;
    }
    div.rssReader div.rssEntry {
        margin-top: 1em;
        margin-bottom: 1em;
    }
    div.rssReader p.rssEntryTitle {
        font-size: 1.25em;
        font-weight: bold;
        margin: 0em;
    }
    div.rssReader p.rssEntryUpdated {
        color: gray;
        font-size: 0.75em;
        margin: 0em;
    }
    div.rssReader p.rssEntryBody {
        margin: 0em;
        padding-top: 1em;
    }

Additional CSS and Notes

For my site (http://rock.heavy.ch/Latest%20News) I had to also to remove some additional html elements, because if you allow some html in your feed, then some feeds will delivery you craps or unwanted stuff (big images, stupid buttons, icons, etcetera..). This spam I do not want to publish, so I removed them via css:

/* size the images */
div.rssReader p.rssEntryBody img,
div.rssReader div.rssEntry img {
    float:              left;
    margin:             10px 10px 10px 0px;
    max-width:          20em;
}

/* don't need the rss feed title, I want to set it in my wiki by myself */
div.rssReader div.rssHeader {
    display:            none;
}

/* away with crap */
p.rssEntryBody img[alt="approved_small"],
div.rssEntry>div>a {
    display:            none;
 }
div.rssReader p.rssEntryBody+p {
    margin-top:         0em;
}

Note: I do use Google Reader together with my mobile phone (Android OS). So I can collect a few feeds, and choose (with a simple "share" button) witch news I would like to show on my wiki. I also planed in the beginning to make some automatical logic, like all article about topic xy should be published, etcetera. This first worked well, but the problem is if you using a a lot of similarly feed readers the "luck" are quite hight that more than one source will publish nearly the same information. And for sure you don't want publish the same news two or more times on your website. Thats why I had to let go my automatic variant and go back to a normal half-auto solution. Btw. if you don't like the google reader, you can install your own rss aggregator like Tiny Tiny RSS (PHP and MySQL], has a lot of interesting features.


Description for old Version 1.0

for older MoinMoin Version (1.5) [[RSSReader(URL-to-RSS-feed-to-display[, allow_html])]] Pass in optional allow_html argument if you trust the source to inject any HTML it wants. You need feedparser. See also macro/FeedParser

Example: [[RSSReader(http://www.kde.org/dot/kde-apps-content.rdf, allow_html)]]


Dependencies

Python Feedparser is needed, see here: http://www.feedparser.org/ or install it by yourself.

setuptools:

sudo easy_install feedparser

ubuntu:

sudo apt-get install python-feedparser

License

ToDo

Some ideas what I need to do:

Bugs

Discussion


  1. Only tested with the latest 1.9.6 version, it may also works with older releases (1)

MoinMoin: MacroMarket/RSSReader (last edited 2012-12-30 22:22:49 by MarcelHäfner)