]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/ActivityParseTests.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / tests / ActivityParseTests.php
1 <?php
2
3 if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
4     print "This script must be run from the command line\n";
5     exit();
6 }
7
8 // XXX: we should probably have some common source for this stuff
9
10 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
11 define('GNUSOCIAL', true);
12 define('STATUSNET', true);  // compatibility
13
14 require_once INSTALLDIR . '/lib/common.php';
15
16 class ActivityParseTests extends PHPUnit_Framework_TestCase
17 {
18     public function testExample1()
19     {
20         global $_example1;
21         $dom = DOMDocument::loadXML($_example1);
22         $act = new Activity($dom->documentElement);
23
24         $this->assertFalse(empty($act));
25
26         $this->assertEquals(1243860840, $act->time);
27         $this->assertEquals(ActivityVerb::POST, $act->verb);
28
29         $this->assertFalse(empty($act->objects[0]));
30         $this->assertEquals('Punctuation Changeset', $act->objects[0]->title);
31         $this->assertEquals('http://versioncentral.example.org/activity/changeset', $act->objects[0]->type);
32         $this->assertEquals('Fixing punctuation because it makes it more readable.', $act->objects[0]->summary);
33         $this->assertEquals('tag:versioncentral.example.org,2009:/change/1643245', $act->objects[0]->id);
34     }
35
36     public function testExample2()
37     {
38         global $_example2;
39         $dom = DOMDocument::loadXML($_example2);
40         $act = new Activity($dom->documentElement);
41
42         $this->assertFalse(empty($act));
43         // Did we handle <content type="html"> correctly with a typical payload?
44         $this->assertEquals("<p>Geraldine posted a Photo on PhotoPanic</p>\n     " .
45                             "<img src=\"/geraldine/photo1.jpg\">", trim($act->content));
46     }
47
48     public function testExample3()
49     {
50         global $_example3;
51         $dom = DOMDocument::loadXML($_example3);
52
53         $feed = $dom->documentElement;
54
55         $entries = $feed->getElementsByTagName('entry');
56
57         $entry = $entries->item(0);
58
59         $act = new Activity($entry, $feed);
60
61         $this->assertFalse(empty($act));
62         $this->assertEquals(1071340202, $act->time);
63         $this->assertEquals('http://example.org/2003/12/13/atom03.html', $act->link);
64
65         $this->assertEquals($act->verb, ActivityVerb::POST);
66
67         $this->assertFalse(empty($act->actor));
68         $this->assertEquals(ActivityObject::PERSON, $act->actor->type);
69         $this->assertEquals('John Doe', $act->actor->title);
70         $this->assertEquals('mailto:johndoe@example.com', $act->actor->id);
71
72         $this->assertFalse(empty($act->objects[0]));
73         $this->assertEquals(ActivityObject::NOTE, $act->objects[0]->type);
74         $this->assertEquals('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', $act->objects[0]->id);
75         $this->assertEquals('Atom-Powered Robots Run Amok', $act->objects[0]->title);
76         $this->assertEquals('Some text.', $act->objects[0]->summary);
77         $this->assertEquals('http://example.org/2003/12/13/atom03.html', $act->objects[0]->link);
78
79         $this->assertFalse(empty($act->context));
80
81         $this->assertTrue(empty($act->target));
82
83         $this->assertEquals($act->entry, $entry);
84         $this->assertEquals($act->feed, $feed);
85     }
86
87     public function testExample4()
88     {
89         global $_example4;
90         $dom = DOMDocument::loadXML($_example4);
91
92         $entry = $dom->documentElement;
93
94         $act = new Activity($entry);
95
96         $this->assertFalse(empty($act));
97         $this->assertEquals(1266547958, $act->time);
98         $this->assertEquals('http://example.net/notice/14', $act->link);
99
100         $this->assertFalse(empty($act->context));
101         $this->assertEquals('http://example.net/notice/12', $act->context->replyToID);
102         $this->assertEquals('http://example.net/notice/12', $act->context->replyToUrl);
103         $this->assertEquals('http://example.net/conversation/11', $act->context->conversation);
104         $this->assertEquals(array('http://example.net/user/1'), array_keys($act->context->attention));
105
106         $this->assertFalse(empty($act->objects[0]));
107         $this->assertEquals($act->objects[0]->content,
108                             '@<span class="vcard"><a href="http://example.net/user/1" class="url"><span class="fn nickname">evan</span></a></span> now is the time for all good men to come to the aid of their country. #<span class="tag"><a href="http://example.net/tag/thetime" rel="tag">thetime</a></span>');
109
110         $this->assertFalse(empty($act->actor));
111     }
112
113     public function testExample5()
114     {
115         global $_example5;
116         $dom = DOMDocument::loadXML($_example5);
117
118         $feed = $dom->documentElement;
119
120         // @todo Test feed elements
121
122         $entries = $feed->getElementsByTagName('entry');
123         $entry = $entries->item(0);
124
125         $act = new Activity($entry, $feed);
126
127         // Post
128         $this->assertEquals($act->verb, ActivityVerb::POST);
129         $this->assertFalse(empty($act->context));
130
131         // Actor w/Portable Contacts stuff
132         $this->assertFalse(empty($act->actor));
133         $this->assertEquals($act->actor->type, ActivityObject::PERSON);
134         $this->assertEquals($act->actor->title, 'Test User');
135         $this->assertEquals($act->actor->id, 'http://example.net/mysite/user/3');
136         $this->assertEquals($act->actor->link, 'http://example.net/mysite/testuser');
137
138         $avatars = $act->actor->avatarLinks;
139
140         $this->assertEquals(
141                 $avatars[0]->url,
142                 'http://example.net/mysite/avatar/3-96-20100224004207.jpeg'
143         );
144
145         $this->assertEquals($act->actor->displayName, 'Test User');
146
147         $poco = $act->actor->poco;
148         $this->assertEquals($poco->preferredUsername, 'testuser');
149         $this->assertEquals($poco->address->formatted, 'San Francisco, CA');
150         $this->assertEquals($poco->urls[0]->type, 'homepage');
151         $this->assertEquals($poco->urls[0]->value, 'http://example.com/blog.html');
152         $this->assertEquals($poco->urls[0]->primary, 'true');
153         $this->assertEquals($act->actor->geopoint, '37.7749295 -122.4194155');
154     }
155
156     public function testExample6()
157     {
158         global $_example6;
159
160         $dom = DOMDocument::loadXML($_example6);
161
162         $rss = $dom->documentElement;
163
164         $channels = $dom->getElementsByTagName('channel');
165
166         $channel = $channels->item(0);
167
168         $items = $channel->getElementsByTagName('item');
169
170         $item = $items->item(0);
171
172         $act = new Activity($item, $channel);
173
174         $this->assertEquals($act->verb, ActivityVerb::POST);
175
176         $this->assertEquals($act->id, 'http://en.blog.wordpress.com/?p=3857');
177         $this->assertEquals($act->link, 'http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/');
178         $this->assertEquals($act->title, 'Rub-a-Dub-Dub in the PubSubHubbub');
179         $this->assertEquals($act->time, 1267634892);
180
181         $actor = $act->actor;
182
183         $this->assertFalse(empty($actor));
184         $this->assertEquals($actor->title, "Joseph Scott");
185     }
186
187     public function testExample7()
188     {
189         global $_example7;
190
191         $dom = DOMDocument::loadXML($_example7);
192
193         $rss = $dom->documentElement;
194
195         $channels = $dom->getElementsByTagName('channel');
196
197         $channel = $channels->item(0);
198
199         $items = $channel->getElementsByTagName('item');
200
201         $item = $items->item(0);
202
203         $act = new Activity($item, $channel);
204
205         $this->assertEquals(ActivityVerb::POST, $act->verb);
206         $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->link);
207         $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->id);
208         $this->assertEquals('Checking out captain bones', $act->title);
209         $this->assertEquals(1269095551, $act->time);
210
211         $actor = $act->actor;
212
213         $this->assertEquals(ActivityObject::PERSON, $actor->type);
214         $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->id);
215         $this->assertEquals('Evan Prodromou', $actor->title);
216         $this->assertNull($actor->summary);
217         $this->assertNull($actor->content);
218         $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->link);
219         $this->assertNull($actor->source);
220         $this->assertTrue(is_array($actor->avatarLinks));
221         $this->assertEquals(1, count($actor->avatarLinks));
222         $this->assertEquals('http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg',
223                             $actor->avatarLinks[0]->url);
224         $this->assertNotNull($actor->poco);
225         $this->assertEquals('evanpro', $actor->poco->preferredUsername);
226         $this->assertEquals('Evan Prodromou', $actor->poco->displayName);
227         $this->assertNull($actor->poco->note);
228         $this->assertNull($actor->poco->address);
229         $this->assertEquals(0, count($actor->poco->urls));
230     }
231
232     // Media test - cliqset
233     public function testExample8()
234     {
235         global $_example8;
236         $dom = DOMDocument::loadXML($_example8);
237
238         $feed = $dom->documentElement;
239
240         $entries = $feed->getElementsByTagName('entry');
241
242         $entry = $entries->item(0);
243
244         $act = new Activity($entry, $feed);
245
246         $this->assertFalse(empty($act));
247         $this->assertEquals($act->time, 1269221753);
248         $this->assertEquals($act->verb, ActivityVerb::POST);
249         $this->assertEquals($act->summary, 'zcopley posted 5 photos on Flickr');
250
251         $this->assertFalse(empty($act->objects));
252         $this->assertEquals(sizeof($act->objects), 5);
253
254         $this->assertEquals($act->objects[0]->type, ActivityObject::PHOTO);
255         $this->assertEquals($act->objects[0]->title, 'IMG_1368');
256         $this->assertNull($act->objects[0]->description);
257         $this->assertEquals(
258             $act->objects[0]->thumbnail,
259             'http://media.cliqset.com/6f6fbee9d7dfbffc73b6ef626275eb5f_thumb.jpg'
260         );
261         $this->assertEquals(
262             $act->objects[0]->link,
263             'http://www.flickr.com/photos/zcopley/4452933806/'
264         );
265
266         $this->assertEquals($act->objects[1]->type, ActivityObject::PHOTO);
267         $this->assertEquals($act->objects[1]->title, 'IMG_1365');
268         $this->assertNull($act->objects[1]->description);
269         $this->assertEquals(
270             $act->objects[1]->thumbnail,
271             'http://media.cliqset.com/b8f3932cd0bba1b27f7c8b3ef986915e_thumb.jpg'
272         );
273         $this->assertEquals(
274             $act->objects[1]->link,
275             'http://www.flickr.com/photos/zcopley/4442630390/'
276         );
277
278         $this->assertEquals($act->objects[2]->type, ActivityObject::PHOTO);
279         $this->assertEquals($act->objects[2]->title, 'Classic');
280         $this->assertEquals(
281             $act->objects[2]->description,
282             '-Powered by pikchur.com/n0u'
283         );
284         $this->assertEquals(
285             $act->objects[2]->thumbnail,
286             'http://media.cliqset.com/fc54c15f850b7a9a8efa644087a48c91_thumb.jpg'
287         );
288         $this->assertEquals(
289             $act->objects[2]->link,
290             'http://www.flickr.com/photos/zcopley/4430754103/'
291         );
292
293         $this->assertEquals($act->objects[3]->type, ActivityObject::PHOTO);
294         $this->assertEquals($act->objects[3]->title, 'IMG_1363');
295         $this->assertNull($act->objects[3]->description);
296
297         $this->assertEquals(
298             $act->objects[3]->thumbnail,
299             'http://media.cliqset.com/4b1d307c9217e2114391a8b229d612cb_thumb.jpg'
300         );
301         $this->assertEquals(
302             $act->objects[3]->link,
303             'http://www.flickr.com/photos/zcopley/4416969717/'
304         );
305
306         $this->assertEquals($act->objects[4]->type, ActivityObject::PHOTO);
307         $this->assertEquals($act->objects[4]->title, 'IMG_1361');
308         $this->assertNull($act->objects[4]->description);
309
310         $this->assertEquals(
311             $act->objects[4]->thumbnail,
312             'http://media.cliqset.com/23d9b4b96b286e0347d36052f22f6e60_thumb.jpg'
313         );
314         $this->assertEquals(
315             $act->objects[4]->link,
316             'http://www.flickr.com/photos/zcopley/4417734232/'
317         );
318
319     }
320
321     public function testAtomContent()
322     {
323         $tests = array(array("<content>Some regular plain text.</content>",
324                              "Some regular plain text."),
325                        array("<content>&lt;b&gt;this is not HTML&lt;/b&gt;</content>",
326                              "&lt;b&gt;this is not HTML&lt;/b&gt;"),
327                        array("<content type='html'>Some regular plain HTML.</content>",
328                              "Some regular plain HTML."),
329                        array("<content type='html'>&lt;b&gt;this is too HTML&lt;/b&gt;</content>",
330                              "<b>this is too HTML</b>"),
331                        array("<content type='html'>&amp;lt;b&amp;gt;but this is not HTML!&amp;lt;/b&amp;gt;</content>",
332                              "&lt;b&gt;but this is not HTML!&lt;/b&gt;"),
333                        array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Some regular plain XHTML.</div></content>",
334                              "Some regular plain XHTML."),
335                        array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'><b>This is some XHTML!</b></div></content>",
336                              "<b>This is some XHTML!</b>"),
337                        array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>&lt;b&gt;This is not some XHTML!&lt;/b&gt;</div></content>",
338                              "&lt;b&gt;This is not some XHTML!&lt;/b&gt;"),
339                        array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>&amp;lt;b&amp;gt;This is not some XHTML either!&amp;lt;/b&amp;gt;</div></content>",
340                              "&amp;lt;b&amp;gt;This is not some XHTML either!&amp;lt;/b&amp;gt;"));
341         foreach ($tests as $data) {
342             list($source, $output) = $data;
343             $xml = "<entry xmlns='http://www.w3.org/2005/Atom'>" .
344                    "<id>http://example.com/fakeid</id>" .
345                    "<author><name>Test</name></author>" .
346                    "<title>Atom content tests</title>" .
347                    $source .
348                    "</entry>";
349             $dom = DOMDocument::loadXML($xml);
350             $act = new Activity($dom->documentElement);
351
352             $this->assertFalse(empty($act));
353             $this->assertEquals($output, trim($act->content));
354         }
355     }
356
357     public function testRssContent()
358     {
359         $tests = array(array("<content:encoded>Some regular plain HTML.</content:encoded>",
360                              "Some regular plain HTML."),
361                        array("<content:encoded>Some &lt;b&gt;exciting bold HTML&lt;/b&gt;</content:encoded>",
362                              "Some <b>exciting bold HTML</b>"),
363                        array("<content:encoded>Some &amp;lt;b&amp;gt;escaped non-HTML.&amp;lt;/b&amp;gt;</content:encoded>",
364                              "Some &lt;b&gt;escaped non-HTML.&lt;/b&gt;"),
365                        array("<description>Some plain text.</description>",
366                              "Some plain text."),
367                        array("<description>Some &lt;b&gt;non-HTML text&lt;/b&gt;</description>",
368                              "Some &lt;b&gt;non-HTML text&lt;/b&gt;"),
369                        array("<description>Some &amp;lt;b&amp;gt;double-escaped text&amp;lt;/b&amp;gt;</description>",
370                              "Some &amp;lt;b&amp;gt;double-escaped text&amp;lt;/b&amp;gt;"));
371         foreach ($tests as $data) {
372             list($source, $output) = $data;
373             $xml = "<item xmlns:content='http://purl.org/rss/1.0/modules/content/'>" .
374                    "<guid>http://example.com/fakeid</guid>" .
375                    "<title>RSS content tests</title>" .
376                    $source .
377                    "</item>";
378             $dom = DOMDocument::loadXML($xml);
379             $act = new Activity($dom->documentElement);
380
381             $this->assertFalse(empty($act));
382             $this->assertEquals($output, trim($act->content));
383         }
384     }
385
386     public function testExample10()
387     {
388         global $_example10;
389         $dom = new DOMDocument();
390         $dom->loadXML($_example10);
391
392         // example 10 is a PuSH item of a post on a group feed, as generated
393         // by 0.9.7 code after migration away from <activity:actor> to <author>
394         $feed = $dom->documentElement;
395         $entry = $dom->getElementsByTagName('entry')->item(0);
396         $expected = 'http://lazarus.local/mublog/user/557';
397
398         // Reading just the entry alone should pick up its own <author>
399         // as the actor.
400         $act = new Activity($entry);
401         $this->assertEquals($act->actor->id, $expected);
402
403         // Reading the entry in feed context used to be buggy, picking up
404         // the feed's <activity:subject> which referred to the group.
405         // It should now be returning the expected author entry...
406         $act = new Activity($entry, $feed);
407         $this->assertEquals($act->actor->id, $expected);
408     }
409
410     public function testBookmarkRelated()
411     {
412         global $_example11;
413         $dom = new DOMDocument();
414         $dom->loadXML($_example11);
415
416         $feed = $dom->documentElement;
417         $entry = $dom->getElementsByTagName('entry')->item(0);
418
419         $expected = 'http://blog.teambox.com/open-source-companies';
420
421         $links = ActivityUtils::getLinks($entry, 'related');
422
423         $this->assertFalse(empty($links));
424         $this->assertTrue(is_array($links));
425         $this->assertEquals(count($links), 1);
426
427         $url = $links[0]->getAttribute('href');
428
429         $this->assertEquals($url, $expected);
430     }
431 }
432
433 $_example1 = <<<EXAMPLE1
434 <?xml version='1.0' encoding='UTF-8'?>
435 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
436   <id>tag:versioncentral.example.org,2009:/commit/1643245</id>
437   <published>2009-06-01T12:54:00Z</published>
438   <title>Geraldine committed a change to yate</title>
439   <content type="xhtml">Geraldine just committed a change to yate on VersionCentral</content>
440   <link rel="alternate" type="text/html"
441         href="http://versioncentral.example.org/geraldine/yate/commit/1643245" />
442   <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
443   <activity:verb>http://versioncentral.example.org/activity/commit</activity:verb>
444   <activity:object>
445     <activity:object-type>http://versioncentral.example.org/activity/changeset</activity:object-type>
446     <id>tag:versioncentral.example.org,2009:/change/1643245</id>
447     <title>Punctuation Changeset</title>
448     <summary>Fixing punctuation because it makes it more readable.</summary>
449     <link rel="alternate" type="text/html" href="..." />
450   </activity:object>
451 </entry>
452 EXAMPLE1;
453
454 $_example2 = <<<EXAMPLE2
455 <?xml version='1.0' encoding='UTF-8'?>
456 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
457   <id>tag:photopanic.example.com,2008:activity01</id>
458   <title>Geraldine posted a Photo on PhotoPanic</title>
459   <published>2008-11-02T15:29:00Z</published>
460   <link rel="alternate" type="text/html" href="/geraldine/activities/1" />
461   <activity:verb>
462   http://activitystrea.ms/schema/1.0/post
463   </activity:verb>
464   <activity:object>
465     <id>tag:photopanic.example.com,2008:photo01</id>
466     <title>My Cat</title>
467     <published>2008-11-02T15:29:00Z</published>
468     <link rel="alternate" type="text/html" href="/geraldine/photos/1" />
469     <activity:object-type>
470       tag:atomactivity.example.com,2008:photo
471     </activity:object-type>
472     <source>
473       <title>Geraldine's Photos</title>
474       <link rel="self" type="application/atom+xml" href="/geraldine/photofeed.xml" />
475       <link rel="alternate" type="text/html" href="/geraldine/" />
476     </source>
477   </activity:object>
478   <content type="html">
479      &lt;p&gt;Geraldine posted a Photo on PhotoPanic&lt;/p&gt;
480      &lt;img src="/geraldine/photo1.jpg"&gt;
481   </content>
482 </entry>
483 EXAMPLE2;
484
485 $_example3 = <<<EXAMPLE3
486 <?xml version="1.0" encoding="utf-8"?>
487
488 <feed xmlns="http://www.w3.org/2005/Atom">
489
490     <title>Example Feed</title>
491     <subtitle>A subtitle.</subtitle>
492     <link href="http://example.org/feed/" rel="self" />
493     <link href="http://example.org/" />
494     <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
495     <updated>2003-12-13T18:30:02Z</updated>
496     <author>
497         <name>John Doe</name>
498         <email>johndoe@example.com</email>
499     </author>
500
501     <entry>
502         <title>Atom-Powered Robots Run Amok</title>
503         <link href="http://example.org/2003/12/13/atom03" />
504         <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
505         <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
506         <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
507         <updated>2003-12-13T18:30:02Z</updated>
508         <summary>Some text.</summary>
509     </entry>
510
511 </feed>
512 EXAMPLE3;
513
514 $_example4 = <<<EXAMPLE4
515 <?xml version='1.0' encoding='UTF-8'?>
516 <entry xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:ostatus="http://ostatus.org/schema/1.0">
517  <title>@evan now is the time for all good men to come to the aid of their country. #thetime</title>
518  <summary>@evan now is the time for all good men to come to the aid of their country. #thetime</summary>
519 <author>
520  <name>spock</name>
521  <uri>http://example.net/user/2</uri>
522 </author>
523 <activity:actor>
524  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
525  <id>http://example.net/user/2</id>
526  <title>spock</title>
527  <link type="image/png" rel="avatar" href="http://example.net/theme/identica/default-avatar-profile.png"></link>
528 </activity:actor>
529  <link rel="alternate" type="text/html" href="http://example.net/notice/14"/>
530  <id>http://example.net/notice/14</id>
531  <published>2010-02-19T02:52:38+00:00</published>
532  <updated>2010-02-19T02:52:38+00:00</updated>
533  <link rel="related" href="http://example.net/notice/12"/>
534  <thr:in-reply-to ref="http://example.net/notice/12" href="http://example.net/notice/12"></thr:in-reply-to>
535  <link rel="ostatus:conversation" href="http://example.net/conversation/11"/>
536  <link rel="mentioned" href="http://example.net/user/1"/>
537  <content type="html">@&lt;span class=&quot;vcard&quot;&gt;&lt;a href=&quot;http://example.net/user/1&quot; class=&quot;url&quot;&gt;&lt;span class=&quot;fn nickname&quot;&gt;evan&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; now is the time for all good men to come to the aid of their country. #&lt;span class=&quot;tag&quot;&gt;&lt;a href=&quot;http://example.net/tag/thetime&quot; rel=&quot;tag&quot;&gt;thetime&lt;/a&gt;&lt;/span&gt;</content>
538  <category term="thetime"></category>
539 </entry>
540 EXAMPLE4;
541
542 $_example5 = <<<EXAMPLE5
543 <?xml version="1.0" encoding="UTF-8"?>
544 <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0">
545  <id>3</id>
546  <title>testuser timeline</title>
547  <subtitle>Updates from testuser on Zach Dev!</subtitle>
548  <logo>http://example.net/mysite/avatar/3-96-20100224004207.jpeg</logo>
549  <updated>2010-02-24T06:38:49+00:00</updated>
550 <author>
551  <name>testuser</name>
552  <uri>http://example.net/mysite/user/3</uri>
553
554 </author>
555  <link href="http://example.net/mysite/testuser" rel="alternate" type="text/html"/>
556  <link href="http://example.net/mysite/api/statuses/user_timeline/3.atom" rel="self" type="application/atom+xml"/>
557  <link href="http://example.net/mysite/main/sup#3" rel="http://api.friendfeed.com/2008/03#sup" type="application/json"/>
558  <link href="http://example.net/mysite/main/push/hub" rel="hub"/>
559  <link href="http://example.net/mysite/main/salmon/user/3" rel="salmon"/>
560 <activity:subject>
561  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
562  <id>http://example.net/mysite/user/3</id>
563  <title>Test User</title>
564  <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
565  <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
566  <georss:point>37.7749295 -122.4194155</georss:point>
567
568 <poco:preferredUsername>testuser</poco:preferredUsername>
569 <poco:displayName>Test User</poco:displayName>
570 <poco:note>Just another test user.</poco:note>
571 <poco:address>
572  <poco:formatted>San Francisco, CA</poco:formatted>
573 </poco:address>
574 <poco:urls>
575  <poco:type>homepage</poco:type>
576  <poco:value>http://example.com/blog.html</poco:value>
577  <poco:primary>true</poco:primary>
578
579 </poco:urls>
580 </activity:subject>
581 <entry>
582  <title>Hey man, is that Freedom Code?! #freedom #hippy</title>
583  <summary>Hey man, is that Freedom Code?! #freedom #hippy</summary>
584 <author>
585  <name>testuser</name>
586  <uri>http://example.net/mysite/user/3</uri>
587 </author>
588 <activity:actor>
589  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
590  <id>http://example.net/mysite/user/3</id>
591  <title>Test User</title>
592  <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
593  <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
594  <georss:point>37.7749295 -122.4194155</georss:point>
595
596 <poco:preferredUsername>testuser</poco:preferredUsername>
597 <poco:displayName>Test User</poco:displayName>
598 <poco:note>Just another test user.</poco:note>
599 <poco:address>
600  <poco:formatted>San Francisco, CA</poco:formatted>
601 </poco:address>
602 <poco:urls>
603  <poco:type>homepage</poco:type>
604  <poco:value>http://example.com/blog.html</poco:value>
605  <poco:primary>true</poco:primary>
606
607 </poco:urls>
608 </activity:actor>
609  <link rel="alternate" type="text/html" href="http://example.net/mysite/notice/7"/>
610  <id>http://example.net/mysite/notice/7</id>
611  <published>2010-02-24T00:53:06+00:00</published>
612  <updated>2010-02-24T00:53:06+00:00</updated>
613  <link rel="ostatus:conversation" href="http://example.net/mysite/conversation/7"/>
614  <content type="html">Hey man, is that Freedom Code?! #&lt;span class=&quot;tag&quot;&gt;&lt;a href=&quot;http://example.net/mysite/tag/freedom&quot; rel=&quot;tag&quot;&gt;freedom&lt;/a&gt;&lt;/span&gt; #&lt;span class=&quot;tag&quot;&gt;&lt;a href=&quot;http://example.net/mysite/tag/hippy&quot; rel=&quot;tag&quot;&gt;hippy&lt;/a&gt;&lt;/span&gt;</content>
615  <georss:point>37.8313160 -122.2852473</georss:point>
616
617 </entry>
618 </feed>
619 EXAMPLE5;
620
621 $_example6 = <<<EXAMPLE6
622 <?xml version="1.0" encoding="UTF-8"?>
623 <rss version="2.0"
624         xmlns:content="http://purl.org/rss/1.0/modules/content/"
625         xmlns:wfw="http://wellformedweb.org/CommentAPI/"
626         xmlns:dc="http://purl.org/dc/elements/1.1/"
627         xmlns:atom="http://www.w3.org/2005/Atom"
628         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
629         xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
630         xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
631         >
632
633         <channel>
634                 <title>WordPress.com News</title>
635                 <atom:link href="http://en.blog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
636                 <link>http://en.blog.wordpress.com</link>
637                 <description>The latest news on WordPress.com and the WordPress community.</description>
638                 <lastBuildDate>Thu, 18 Mar 2010 23:25:35 +0000</lastBuildDate>
639
640                 <generator>http://wordpress.com/</generator>
641                 <language>en</language>
642                 <sy:updatePeriod>hourly</sy:updatePeriod>
643                 <sy:updateFrequency>1</sy:updateFrequency>
644                 <cloud domain='en.blog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
645                 <image>
646                         <url>http://www.gravatar.com/blavatar/e6392390e3bcfadff3671c5a5653d95b?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
647                         <title>WordPress.com News</title>
648                         <link>http://en.blog.wordpress.com</link>
649                 </image>
650                 <atom:link rel="search" type="application/opensearchdescription+xml" href="http://en.blog.wordpress.com/osd.xml" title="WordPress.com News" />
651                 <atom:link rel='hub' href='http://en.blog.wordpress.com/?pushpress=hub'/>
652
653                 <item>
654                         <title>Rub-a-Dub-Dub in the PubSubHubbub</title>
655                         <link>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/</link>
656                         <comments>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/#comments</comments>
657                         <pubDate>Wed, 03 Mar 2010 16:48:12 +0000</pubDate>
658                         <dc:creator>Joseph Scott</dc:creator>
659
660                         <category><![CDATA[Feeds]]></category>
661                         <category><![CDATA[atom]]></category>
662                         <category><![CDATA[pubsubhubbub]]></category>
663                         <category><![CDATA[rss]]></category>
664
665                         <guid isPermaLink="false">http://en.blog.wordpress.com/?p=3857</guid>
666                         <description><![CDATA[From the tongue twisting name department we welcome PubSubHubbub, or as some people have shortened it to: PuSH.  Like rssCloud, PuSH is a way for services that subscribe to updates from your blog (think Google Reader, Bloglines or Netvibes) to get updates even faster.  In a nutshell, instead of having to periodically ask [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=en.blog.wordpress.com&blog=3584907&post=3857&subd=en.blog&ref=&feed=1" />]]></description>
667                                 <content:encoded><![CDATA[<p>From the tongue twisting name department we welcome <a href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub</a>, or as some people have shortened it to: PuSH.  Like <a href="http://en.blog.wordpress.com/2009/09/07/rss-in-the-clouds/">rssCloud</a>, PuSH is a way for services that subscribe to updates from your blog (think Google Reader, Bloglines or Netvibes) to get updates even faster.  In a nutshell, instead of having to periodically ask your blog if there are any updates they can now register to automatically receive updates each time you publish new content.  In most cases these updates are sent out within a second or two of when you hit the publish button.</p>
668         <p>Today we&#8217;ve turned on PuSH support for the more than 10.5 million blogs on WordPress.com.  There&#8217;s nothing to configure, it&#8217;s working right now behind the scenes to help others keep up to date with your posts.</p>
669         <p>For those using the WordPress.org software we are releasing a new PuSH plugin: <a href="http://wordpress.org/extend/plugins/pushpress/">PuSHPress</a>.  This plugin differs from the current PuSH related plugins by including a built-in hub.</p>
670         <p>For more PuSH related reading check out the <a href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub project site</a> and <a href="http://groups.google.com/group/pubsubhubbub?pli=1">Google Group</a>.  And if you really want to geek out there&#8217;s always the <a href="http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html">PubSubHubbub Spec</a> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
671         <br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/en.blog.wordpress.com/3857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/en.blog.wordpress.com/3857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/en.blog.wordpress.com/3857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/en.blog.wordpress.com/3857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/en.blog.wordpress.com/3857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/en.blog.wordpress.com/3857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/en.blog.wordpress.com/3857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/en.blog.wordpress.com/3857/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/en.blog.wordpress.com/3857/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/en.blog.wordpress.com/3857/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=en.blog.wordpress.com&blog=3584907&post=3857&subd=en.blog&ref=&feed=1" />]]></content:encoded>
672                                 <wfw:commentRss>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/feed/</wfw:commentRss>
673
674                         <slash:comments>96</slash:comments>
675
676                         <media:content url="http://1.gravatar.com/avatar/582b66ad5ae1b69c7601a990cb9a661a?s=96&#38;d=identicon" medium="image">
677                                 <media:title type="html">josephscott</media:title>
678                         </media:content>
679                 </item>
680         </channel>
681 </rss>
682 EXAMPLE6;
683
684 $_example7 = <<<EXAMPLE7
685 <?xml version="1.0" encoding="UTF-8"?>
686         <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
687           <channel>
688             <title>evanpro's posterous</title>
689             <link>http://evanpro.posterous.com</link>
690             <description>Most recent posts at evanpro's posterous</description>
691             <generator>posterous.com</generator>
692             <link type="application/json" xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://posterous.com/api/sup_update#56bcc5eb7"/>
693             <atom:link rel="self" href="http://evanpro.posterous.com/rss.xml"/>
694             <atom:link rel="hub" href="http://posterous.superfeedr.com"/>
695             <item>
696               <pubDate>Sat, 20 Mar 2010 07:32:31 -0700</pubDate>
697               <title>Checking out captain bones</title>
698               <link>http://evanpro.posterous.com/checking-out-captain-bones</link>
699               <guid>http://evanpro.posterous.com/checking-out-captain-bones</guid>
700               <description>
701                 <![CDATA[<p>
702                 <p>Bones!</p>
703
704         </p>
705
706         <p><a href="http://evanpro.posterous.com/checking-out-captain-bones">Permalink</a>
707
708                 | <a href="http://evanpro.posterous.com/checking-out-captain-bones#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>
709
710         </p>]]>
711               </description>
712               <posterous:author>
713                 <posterous:userImage>http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg</posterous:userImage>
714                 <posterous:profileUrl>http://posterous.com/people/3sDslhaepotz</posterous:profileUrl>
715                 <posterous:firstName>Evan</posterous:firstName>
716                 <posterous:lastnNme>Prodromou</posterous:lastnNme>
717                 <posterous:nickName>evanpro</posterous:nickName>
718                 <posterous:displayName>Evan Prodromou</posterous:displayName>
719               </posterous:author>
720             </item>
721         </channel>
722 </rss>
723 EXAMPLE7;
724
725 $_example8 = <<<EXAMPLE8
726 <?xml version="1.0"?>
727 <feed xmlns="http://www.w3.org/2005/Atom">
728     <link href="http://pubsubhubbub.appspot.com/" rel="hub"/>
729     <title type="text">Activity Stream for: zcopley</title>
730     <id>http://cliqset.com/feed/atom?uid=zcopley</id>
731     <entry xmlns:service="http://activitystrea.ms/service-provider" xmlns:activity="http://activitystrea.ms/spec/1.0/">
732         <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total>
733         <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
734         <published>2010-03-22T01:35:53.000Z</published>
735         <service:provider>
736             <name>flickr</name>
737             <uri>http://flickr.com</uri>
738             <icon>http://cliqset-services.s3.amazonaws.com/flickr.png</icon>
739         </service:provider>
740         <activity:object>
741             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
742             <title type="text">IMG_1368</title>
743             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/6f6fbee9d7dfbffc73b6ef626275eb5f_thumb.jpg"/>
744             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4452933806/"/>
745         </activity:object>
746         <activity:object>
747             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
748             <title type="text">IMG_1365</title>
749             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/b8f3932cd0bba1b27f7c8b3ef986915e_thumb.jpg"/>
750             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4442630390/"/>
751         </activity:object>
752         <activity:object xmlns:media="http://purl.org/syndication/atommedia">
753             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
754             <title type="text">Classic</title>
755             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/fc54c15f850b7a9a8efa644087a48c91_thumb.jpg"/>
756             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4430754103/"/>
757             <media:description type="text">-Powered by pikchur.com/n0u</media:description>
758         </activity:object>
759         <activity:object>
760             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
761             <title type="text">IMG_1363</title>
762             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/4b1d307c9217e2114391a8b229d612cb_thumb.jpg"/>
763             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4416969717/"/>
764         </activity:object>
765         <activity:object>
766             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
767             <title type="text">IMG_1361</title>
768             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/23d9b4b96b286e0347d36052f22f6e60_thumb.jpg"/>
769             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4417734232/"/>
770         </activity:object>
771         <title type="text">zcopley posted some photos on Flickr</title>
772         <summary type="text">zcopley posted 5 photos on Flickr</summary>
773         <category scheme="http://schemas.cliqset.com/activity/categories/1.0" term="PhotoPosted" label="Photo Posted"/>
774         <updated>2010-03-22T20:46:42.778Z</updated>
775         <id>tag:cliqset.com,2010-03-22:/user/zcopley/SVgAZubGhtAnSAee</id>
776         <link href="http://cliqset.com/user/zcopley/SVgAZubGhtAnSAee" type="text/xhtml" rel="alternate" title="zcopley posted some photos on Flickr"/>
777         <author>
778             <name>zcopley</name>
779             <uri>http://cliqset.com/user/zcopley</uri>
780         </author>
781         <activity:actor xmlns:poco="http://portablecontacts.net/spec/1.0">
782             <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
783             <id>zcopley</id>
784             <poco:name>
785                 <poco:givenName>Zach</poco:givenName>
786                 <poco:familyName>Copley</poco:familyName>
787             </poco:name>
788             <link xmlns:media="http://purl.org/syndication/atommedia" type="image/png" rel="avatar" href="http://dynamic.cliqset.com/avatar/zcopley?s=80" media:height="80" media:width="80"/>
789             <link xmlns:media="http://purl.org/syndication/atommedia" type="image/png" rel="avatar" href="http://dynamic.cliqset.com/avatar/zcopley?s=120" media:height="120" media:width="120"/>
790             <link xmlns:media="http://purl.org/syndication/atommedia" type="image/png" rel="avatar" href="http://dynamic.cliqset.com/avatar/zcopley?s=200" media:height="200" media:width="200"/>
791         </activity:actor>
792     </entry>
793 </feed>
794 EXAMPLE8;
795
796 $_example9 = <<<EXAMPLE9
797 <?xml version="1.0" encoding="utf-8"?>
798 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:media="http://search.yahoo.com/mrss" xmlns:activity="http://activitystrea.ms/spec/1.0/">
799     <link rel="self" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/117848251937215158042/public/posted"/>
800     <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
801     <title type="text">Google Buzz</title>
802     <updated>2010-03-22T01:55:53.596Z</updated>
803     <id>tag:google.com,2009:buzz-feed/public/posted/117848251937215158042</id>
804     <generator>Google - Google Buzz</generator>
805     <entry>
806         <title type="html">Buzz by Zach Copley from Flickr</title>
807         <summary type="text">IMG_1366</summary>
808         <published>2010-03-18T04:29:23.000Z</published>
809         <updated>2010-03-18T05:14:03.325Z</updated>
810         <id>tag:google.com,2009:buzz/z12zwdhxowq2d13q204cjr04kzu0cns5gh0</id>
811         <link rel="alternate" type="text/html" href="http://www.google.com/buzz/117848251937215158042/ZU7b6mHJEmC/IMG-1366"/>
812         <author>
813             <name>Zach Copley</name>
814             <uri>http://www.google.com/profiles/zcopley</uri>
815         </author>
816         <content type="html">&lt;div&gt;IMG_1366&lt;/div&gt;</content>
817         <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" title="IMG_1366"/>
818         <media:content url="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" medium="image">
819             <media:title>IMG_1366</media:title>
820             <media:player url="http://farm5.static.flickr.com/4053/4442630700_980b19a1a6_o.jpg" height="1600" width="1200"/>
821         </media:content>
822         <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" title="IMG_1365"/>
823         <media:content url="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" medium="image">
824             <media:title>IMG_1365</media:title>
825             <media:player url="http://farm5.static.flickr.com/4043/4442630390_62da5560ae_o.jpg" height="1200" width="1600"/>
826         </media:content>
827         <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
828         <activity:object>
829             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
830             <id>tag:google.com,2009:buzz/z12zwdhxowq2d13q204cjr04kzu0cns5gh0</id>
831             <title>Buzz by Zach Copley from Flickr</title>
832             <content type="html">&lt;div&gt;IMG_1366&lt;/div&gt;</content>
833             <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" title="IMG_1366"/>
834             <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" title="IMG_1365"/>
835         </activity:object>
836         <link rel="replies" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/117848251937215158042/comments/z12zwdhxowq2d13q204cjr04kzu0cns5gh0" thr:count="0"/>
837         <thr:total>0</thr:total>
838     </entry>
839 </feed>
840 EXAMPLE9;
841
842 // Sample PuSH entry from a group feed in 0.9.7
843 // Old <activity:actor> has been removed from entries in this version.
844 // A bug in the order of input processing meant that we were incorrectly
845 // reading the feed's <activity:subject> instead of the entry's <author>,
846 // causing the entry to get rejected as malformed (groups can't post on
847 // their own; we want to see the actual author's info here).
848 $_example10 = <<<EXAMPLE10
849 <?xml version="1.0" encoding="UTF-8"?>
850 <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/">
851  <generator uri="http://status.net" version="0.9.7alpha1">StatusNet</generator>
852  <id>http://lazarus.local/mublog/api/statusnet/groups/timeline/22.atom</id>
853  <title>grouptest316173 timeline</title>
854  <subtitle>Updates from grouptest316173 on Blaguette!</subtitle>
855  <logo>http://lazarus.local/mublog/theme/default/default-avatar-profile.png</logo>
856  <updated>2011-01-06T22:44:18+00:00</updated>
857 <author>
858  <activity:object-type>http://activitystrea.ms/schema/1.0/group</activity:object-type>
859  <uri>http://lazarus.local/mublog/group/22/id</uri>
860  <name>grouptest316173</name>
861  <link rel="alternate" type="text/html" href="http://lazarus.local/mublog/group/22/id"/>
862  <link rel="avatar" type="image/png" media:width="96" media:height="96" href="http://lazarus.local/mublog/theme/default/default-avatar-profile.png"/>
863  <link rel="avatar" type="image/png" media:width="48" media:height="48" href="http://lazarus.local/mublog/theme/default/default-avatar-stream.png"/>
864  <link rel="avatar" type="image/png" media:width="24" media:height="24" href="http://lazarus.local/mublog/theme/default/default-avatar-mini.png"/>
865  <poco:preferredUsername>grouptest316173</poco:preferredUsername>
866  <poco:displayName>grouptest316173</poco:displayName>
867 </author>
868 <activity:subject>
869  <activity:object-type>http://activitystrea.ms/schema/1.0/group</activity:object-type>
870  <id>http://lazarus.local/mublog/group/22/id</id>
871  <title>grouptest316173</title>
872  <link rel="alternate" type="text/html" href="http://lazarus.local/mublog/group/22/id"/>
873  <link rel="avatar" type="image/png" media:width="96" media:height="96" href="http://lazarus.local/mublog/theme/default/default-avatar-profile.png"/>
874  <link rel="avatar" type="image/png" media:width="48" media:height="48" href="http://lazarus.local/mublog/theme/default/default-avatar-stream.png"/>
875  <link rel="avatar" type="image/png" media:width="24" media:height="24" href="http://lazarus.local/mublog/theme/default/default-avatar-mini.png"/>
876  <poco:preferredUsername>grouptest316173</poco:preferredUsername>
877  <poco:displayName>grouptest316173</poco:displayName>
878 </activity:subject>
879  <link href="http://lazarus.local/mublog/group/grouptest316173" rel="alternate" type="text/html"/>
880  <link href="http://lazarus.local/mublog/main/push/hub" rel="hub"/>
881  <link href="http://lazarus.local/mublog/main/salmon/group/22" rel="salmon"/>
882  <link href="http://lazarus.local/mublog/main/salmon/group/22" rel="http://salmon-protocol.org/ns/salmon-replies"/>
883  <link href="http://lazarus.local/mublog/main/salmon/group/22" rel="http://salmon-protocol.org/ns/salmon-mention"/>
884  <link href="http://lazarus.local/mublog/api/statusnet/groups/timeline/22.atom" rel="self" type="application/atom+xml"/>
885  <statusnet:group_info member_count="2"></statusnet:group_info>
886 <entry>
887  <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
888  <id>http://lazarus.local/mublog/notice/1243</id>
889  <title>Group post from local to !grouptest316173, should go out over push.</title>
890  <content type="html">Group post from local to !&lt;span class=&quot;vcard&quot;&gt;&lt;a href=&quot;http://lazarus.local/mublog/group/22/id&quot; class=&quot;url&quot;&gt;&lt;span class=&quot;fn nickname&quot;&gt;grouptest316173&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;, should go out over push.</content>
891  <link rel="alternate" type="text/html" href="http://lazarus.local/mublog/notice/1243"/>
892  <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
893  <published>2011-01-06T22:44:18+00:00</published>
894  <updated>2011-01-06T22:44:18+00:00</updated>
895  <author>
896   <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
897   <uri>http://lazarus.local/mublog/user/557</uri>
898   <name>Pubtest316173 Smith</name>
899   <link rel="alternate" type="text/html" href="http://lazarus.local/mublog/pubtest316173"/>
900   <link rel="avatar" type="image/png" media:width="96" media:height="96" href="http://lazarus.local/mublog/theme/default/default-avatar-profile.png"/>
901   <link rel="avatar" type="image/png" media:width="48" media:height="48" href="http://lazarus.local/mublog/theme/default/default-avatar-stream.png"/>
902   <link rel="avatar" type="image/png" media:width="24" media:height="24" href="http://lazarus.local/mublog/theme/default/default-avatar-mini.png"/>
903   <poco:preferredUsername>pubtest316173</poco:preferredUsername>
904   <poco:displayName>Pubtest316173 Smith</poco:displayName>
905   <poco:note>Stub account for OStatus tests.</poco:note>
906   <poco:urls>
907    <poco:type>homepage</poco:type>
908    <poco:value>http://example.org/pubtest316173</poco:value>
909    <poco:primary>true</poco:primary>
910   </poco:urls>
911  </author>
912  <link rel="ostatus:conversation" href="http://lazarus.local/mublog/conversation/1131"/>
913  <link rel="mentioned" href="http://lazarus.local/mublog/group/22/id"/>
914  <category term="grouptest316173"></category>
915  <source>
916   <id>http://lazarus.local/mublog/api/statuses/user_timeline/557.atom</id>
917   <title>Pubtest316173 Smith</title>
918   <link rel="alternate" type="text/html" href="http://lazarus.local/mublog/pubtest316173"/>
919   <link rel="self" type="application/atom+xml" href="http://lazarus.local/mublog/api/statuses/user_timeline/557.atom"/>
920   <link rel="license" href="http://creativecommons.org/licenses/by/3.0/"/>
921   <icon>http://lazarus.local/mublog/theme/default/default-avatar-profile.png</icon>
922   <updated>2011-01-06T22:44:18+00:00</updated>
923  </source>
924  <link rel="self" type="application/atom+xml" href="http://lazarus.local/mublog/api/statuses/show/1243.atom"/>
925  <link rel="edit" type="application/atom+xml" href="http://lazarus.local/mublog/api/statuses/show/1243.atom"/>
926  <statusnet:notice_info local_id="1243" source="api"></statusnet:notice_info>
927 </entry>
928 </feed>
929 EXAMPLE10;
930
931 $_example11 = <<<EXAMPLE11
932 <?xml version="1.0" encoding="UTF-8"?>
933 <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/">
934  <generator uri="http://status.net" version="0.9.7">StatusNet</generator>
935  <id>http://freelish.us/api/statuses/user_timeline/1.atom</id>
936  <title>demon timeline</title>
937  <subtitle>Updates from demon on freelish.us!</subtitle>
938  <logo>http://avatar.status.net/f/freelishus/1-96-20110331163048.jpeg</logo>
939  <updated>2011-05-30T09:36:03-04:00</updated>
940 <author>
941  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
942  <uri>http://freelishus.status.net/user/1</uri>
943  <name>demon</name>
944  <link rel="alternate" type="text/html" href="http://freelish.us/demon"/>
945  <link rel="avatar" type="image/jpeg" media:width="192" media:height="192" href="http://avatar.status.net/f/freelishus/1-192-20110331163048.jpeg"/>
946  <link rel="avatar" type="image/jpeg" media:width="96" media:height="96" href="http://avatar.status.net/f/freelishus/1-96-20110331163048.jpeg"/>
947  <link rel="avatar" type="image/jpeg" media:width="48" media:height="48" href="http://avatar.status.net/f/freelishus/1-48-20110331163048.jpeg"/>
948  <link rel="avatar" type="image/jpeg" media:width="24" media:height="24" href="http://avatar.status.net/f/freelishus/1-24-20110331163049.jpeg"/>
949  <georss:point>45.50884 -73.58781</georss:point>
950  <poco:preferredUsername>demon</poco:preferredUsername>
951  <poco:displayName>Evan Prodromou</poco:displayName>
952  <poco:note>Montreal hacker and entrepreneur.</poco:note>
953  <poco:address>
954   <poco:formatted>Montreal, Quebec</poco:formatted>
955
956 </poco:address>
957  <poco:urls>
958   <poco:type>homepage</poco:type>
959   <poco:value>http://evan.status.net/</poco:value>
960   <poco:primary>true</poco:primary>
961 </poco:urls>
962  <statusnet:profile_info local_id="1"></statusnet:profile_info>
963 </author>
964 <!--Deprecation warning: activity:subject is present only for backward compatibility. It will be removed in the next version of StatusNet.-->
965 <activity:subject>
966  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
967  <id>http://freelishus.status.net/user/1</id>
968  <title>Evan Prodromou</title>
969  <link rel="alternate" type="text/html" href="http://freelish.us/demon"/>
970  <link rel="avatar" type="image/jpeg" media:width="192" media:height="192" href="http://avatar.status.net/f/freelishus/1-192-20110331163048.jpeg"/>
971  <link rel="avatar" type="image/jpeg" media:width="96" media:height="96" href="http://avatar.status.net/f/freelishus/1-96-20110331163048.jpeg"/>
972  <link rel="avatar" type="image/jpeg" media:width="48" media:height="48" href="http://avatar.status.net/f/freelishus/1-48-20110331163048.jpeg"/>
973  <link rel="avatar" type="image/jpeg" media:width="24" media:height="24" href="http://avatar.status.net/f/freelishus/1-24-20110331163049.jpeg"/>
974  <georss:point>45.50884 -73.58781</georss:point>
975  <poco:preferredUsername>demon</poco:preferredUsername>
976  <poco:displayName>Evan Prodromou</poco:displayName>
977  <poco:note>Montreal hacker and entrepreneur.</poco:note>
978  <poco:address>
979   <poco:formatted>Montreal, Quebec</poco:formatted>
980
981 </poco:address>
982  <poco:urls>
983   <poco:type>homepage</poco:type>
984   <poco:value>http://evan.status.net/</poco:value>
985   <poco:primary>true</poco:primary>
986 </poco:urls>
987  <statusnet:profile_info local_id="1"></statusnet:profile_info>
988 </activity:subject>
989  <link href="http://freelish.us/demon" rel="alternate" type="text/html"/>
990  <link href="http://freelish.us/main/sup#1" rel="http://api.friendfeed.com/2008/03#sup" type="application/json"/>
991  <link href="http://freelish.us/api/statuses/user_timeline/1.atom?max_id=13210408" rel="next" type="application/atom+xml"/>
992  <link href="http://freelish.us/main/push/hub" rel="hub"/>
993  <link href="http://freelish.us/main/salmon/user/1" rel="salmon"/>
994  <link href="http://freelish.us/main/salmon/user/1" rel="http://salmon-protocol.org/ns/salmon-replies"/>
995  <link href="http://freelish.us/main/salmon/user/1" rel="http://salmon-protocol.org/ns/salmon-mention"/>
996  <link href="http://freelish.us/api/statuses/user_timeline/1.atom" rel="self" type="application/atom+xml"/>
997
998 <entry>
999  <activity:object-type>http://activitystrea.ms/schema/1.0/bookmark</activity:object-type>
1000  <id>http://freelish.us/bookmark/9e930c3e-7ed9-47de-aba5-df6c60cec542</id>
1001  <title>Why you should build an open-source startup | Teambox Blog</title>
1002  <link rel="alternate" type="text/html" href="http://freelish.us/bookmark/9e930c3e-7ed9-47de-aba5-df6c60cec542"/>
1003  <link rel="related" href="http://blog.teambox.com/open-source-companies"/>
1004  <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
1005  <published>2011-05-26T20:36:25+00:00</published>
1006  <updated>2011-05-26T20:36:25+00:00</updated>
1007  <link rel="ostatus:conversation" href="http://freelish.us/conversation/13835232"/>
1008  <category term="opensource"></category>
1009  <category term="startup"></category>
1010  <link rel="self" type="application/atom+xml" href="http://freelish.us/api/statuses/show/13836862.atom"/>
1011  <link rel="edit" type="application/atom+xml" href="http://freelish.us/api/statuses/show/13836862.atom"/>
1012  <statusnet:notice_info local_id="13836862" source="web" favorite="false" repeated="false"></statusnet:notice_info>
1013
1014 </entry>
1015 </feed>
1016 EXAMPLE11;