forked from ProgerXP/Feeder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-array.php
42 lines (37 loc) · 1.46 KB
/
example-array.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require_once 'feeder.php';
$channel = array(
'title' => 'My Feed',
'author' => 'Proger_XP proger.xp@gmail.com http://proger.i-forge.net',
'description' => 'Just another PHP Feed',
'category' => 'http://example.com Category Label here.',
// it doesn't matter what follows "category" after a space - we need
// something so this array key is unique and won't override preceding one:
'category 2' => 'Second Label',
'icon' => '100x20 http://example.com/icon.gif',
// it's only possible to set width, height and image URL using text form:
'logo' => '121x83 http://example.com/logo.png',
);
$entries = array(
array(
'title' => 'My first post',
'updated' => strtotime('22 Jan 2011'),
'author' => 'Proger_XP proger.xp@gmail.com',
'content' => 'Thinking about something to write...',
'content html' => 'Thinking about <em>something</em> to write…',
),
array(
'title' => 'Another filler',
'updated' => strtotime('23 May 2012'),
'author' => 'Proger_XP proger.xp@gmail.com',
'contributor' => 'Camilo http://camilomm.deviantart.com',
'content html' => 'Why? Because he\'s my friend <img src="smile.png" />',
),
);
$feeder = new Feeder;
$feeder->Channel()->SetFromArray($channel);
foreach ($entries as $i => $entry) {
$feeder->Entry($i, new FeedEntry($entry));
}
$output = new AtomFeed;
$output->Output($feeder);