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