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