PHP Classes

File: Services/wordpress.example

Recommend this page to a friend!
  Classes of Leonardo Branco Shinagawa   Feedee   Services/wordpress.example   Download  
File: Services/wordpress.example
Role: Example script
Content type: text/plain
Description: Wordpress example
Class: Feedee
Retrieve and parse RSS feed from remote sites
Author: By
Last change: added video support example
Date: 12 years ago
Size: 620 bytes
 

Contents

Class file image Download
<?php

/* EXAMPLE */

$wordpress = new Feedee('wordpress');
$wordpress->setUrl('http://example.wordpress.url/feed=rss2'); //MUST be rss2

foreach ($wordpress as $post)
{
        echo
'<h1><a href="'.$post->link.'">'.$post->title.'</a></h1>';
        echo
'<p>'.$post->content.'</p>';
}


/* ATTRIBUTES */
$post->link;
$post->title;
$post->pubDate;
$post->description;
$post->content;
$post->image; //Return the url of the first image founded on the Content.
$post->getVideo($width, $height); //Return the object/embed tag of the first video founded on the Content. Width and/or Height can be setted.