PHP Classes

File: example-object.php

Recommend this page to a friend!
  Classes of Pavel   Feeder   example-object.php   Download  
File: example-object.php
Role: Example script
Content type: text/plain
Description: Example - creating objects and populating the channel.
Class: Feeder
Generate feeds in RSS and Atom formats
Author: By
Last change: Accessible without user login
Date: 11 years ago
Size: 1,277 bytes


Class file image Download
require_once 'feeder.php';

$proger = new FeedPerson;

$camilo = new FeedPerson;

$feeder = new Feeder;

$feeder->Channel()->Title()->Add('text', 'My Feed');
$feeder->Channel()->Author(0, $proger);
$feeder->Channel()->Description()->Add('text', 'Just another PHP Feed');

$entry = new FeedEntry;

$entry->Title()->Add('text', 'My first post');
$entry->Updated(strtotime('22 Jan 2011'));
$entry->Author(0, $proger);
$entry->Content()->Add('text', 'Thinking about something to write...');
$entry->Content()->Add('html', 'Thinking about <em>something</em> to write&hellip;');

$feeder->Entry(0, $entry);

$entry = new FeedEntry;

$entry->Title()->Add('text', 'Another filler');
$entry->Updated(strtotime('23 May 2012'));
$entry->Author(0, $proger);
$entry->Contributor(0, $camilo);
$entry->Content()->Add('html', 'Why? Because he\'s my friend <img src="smile.png" />');

$feeder->Entry(1, $entry);

$output = new AtomFeed;