Jump to content

Markup Load Atom


teppo
 Share

Recommended Posts

Another minor addition to happy family of ProcessWire modules: Markup Load Atom.

Markup Load Atom was forked from Ryan's Markup Load RSS to provide similar functionality for Atom feeds: given Atom feed URL it loads it and allows you to foreach through it and/or render it with built-in render() method.

Get it from GitHub: https://github.com/teppokoivula/MarkupLoadAtom

Note: I've been using this on a production site for a while now, but haven't really worked much with Atom feeds specifically. If you're a guru in that matter and feel that something is odd or plain wrong here, please let me know and I'll see what I can do.

How to use

With your own markup:

$atom = $modules->get("MarkupLoadAtom"); 
$atom->load("https://github.com/ryancramerdesign/ProcessWire/commits/master.atom");

foreach($atom as $item) { 
    echo "<p>";
    echo "<a href='{$item->url}'>{$item->title}</a> ";
    echo $item->date . "<br /> ";
    echo $item->body; 
    echo "</p>";
}

Or with built-in rendering:

$atom = $modules->get("MarkupLoadAtom");
echo $atom->render("https://github.com/ryancramerdesign/ProcessWire/commits/master.atom");

Installation

Installing is identical to most other modules; just copy MarkupLoadAtom.module or whole MarkupLoadAtom directory to your /site/modules/, hit "Check for new modules" at Admin modules area and install "Markup Load Atom".

More examples, detailed instructions etc. can be found from README.

  • Like 8
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...