]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/ActivityParseTests.php
Merge branch 'testing' into 0.9.x
[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('STATUSNET', true);
12
13 require_once INSTALLDIR . '/lib/common.php';
14
15 class ActivityParseTests extends PHPUnit_Framework_TestCase
16 {
17     public function testExample1()
18     {
19         global $_example1;
20         $dom = DOMDocument::loadXML($_example1);
21         $act = new Activity($dom->documentElement);
22
23         $this->assertFalse(empty($act));
24
25         $this->assertEquals($act->time, 1243860840);
26         $this->assertEquals($act->verb, ActivityVerb::POST);
27
28         $this->assertFalse(empty($act->object));
29         $this->assertEquals($act->object->title, 'Punctuation Changeset');
30         $this->assertEquals($act->object->type, 'http://versioncentral.example.org/activity/changeset');
31         $this->assertEquals($act->object->summary, 'Fixing punctuation because it makes it more readable.');
32         $this->assertEquals($act->object->id, 'tag:versioncentral.example.org,2009:/change/1643245');
33     }
34
35     public function testExample3()
36     {
37         global $_example3;
38         $dom = DOMDocument::loadXML($_example3);
39
40         $feed = $dom->documentElement;
41
42         $entries = $feed->getElementsByTagName('entry');
43
44         $entry = $entries->item(0);
45
46         $act = new Activity($entry, $feed);
47
48         $this->assertFalse(empty($act));
49         $this->assertEquals($act->time, 1071340202);
50         $this->assertEquals($act->link, 'http://example.org/2003/12/13/atom03.html');
51
52         $this->assertEquals($act->verb, ActivityVerb::POST);
53
54         $this->assertFalse(empty($act->actor));
55         $this->assertEquals($act->actor->type, ActivityObject::PERSON);
56         $this->assertEquals($act->actor->title, 'John Doe');
57         $this->assertEquals($act->actor->id, 'mailto:johndoe@example.com');
58
59         $this->assertFalse(empty($act->object));
60         $this->assertEquals($act->object->type, ActivityObject::NOTE);
61         $this->assertEquals($act->object->id, 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a');
62         $this->assertEquals($act->object->title, 'Atom-Powered Robots Run Amok');
63         $this->assertEquals($act->object->summary, 'Some text.');
64         $this->assertEquals($act->object->link, 'http://example.org/2003/12/13/atom03.html');
65
66         $this->assertFalse(empty($act->context));
67
68         $this->assertTrue(empty($act->target));
69
70         $this->assertEquals($act->entry, $entry);
71         $this->assertEquals($act->feed, $feed);
72     }
73
74     public function testExample4()
75     {
76         global $_example4;
77         $dom = DOMDocument::loadXML($_example4);
78
79         $entry = $dom->documentElement;
80
81         $act = new Activity($entry);
82
83         $this->assertFalse(empty($act));
84         $this->assertEquals(1266547958, $act->time);
85         $this->assertEquals('http://example.net/notice/14', $act->link);
86
87         $this->assertFalse(empty($act->context));
88         $this->assertEquals('http://example.net/notice/12', $act->context->replyToID);
89         $this->assertEquals('http://example.net/notice/12', $act->context->replyToUrl);
90         $this->assertEquals('http://example.net/conversation/11', $act->context->conversation);
91         $this->assertEquals(array('http://example.net/user/1'), $act->context->attention);
92
93         $this->assertFalse(empty($act->object));
94         $this->assertEquals($act->object->content,
95                             '@<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>');
96
97         $this->assertFalse(empty($act->actor));
98     }
99
100     public function testExample5()
101     {
102         global $_example5;
103         $dom = DOMDocument::loadXML($_example5);
104
105         $feed = $dom->documentElement;
106
107         // @todo Test feed elements
108
109         $entries = $feed->getElementsByTagName('entry');
110         $entry = $entries->item(0);
111
112         $act = new Activity($entry, $feed);
113
114         // Post
115         $this->assertEquals($act->verb, ActivityVerb::POST);
116         $this->assertFalse(empty($act->context));
117
118         // Actor w/Portable Contacts stuff
119         $this->assertFalse(empty($act->actor));
120         $this->assertEquals($act->actor->type, ActivityObject::PERSON);
121         $this->assertEquals($act->actor->title, 'Test User');
122         $this->assertEquals($act->actor->id, 'http://example.net/mysite/user/3');
123         $this->assertEquals($act->actor->link, 'http://example.net/mysite/testuser');
124
125         $avatars = $act->actor->avatarLinks;
126
127         $this->assertEquals(
128                 $avatars[0]->url,
129                 'http://example.net/mysite/avatar/3-96-20100224004207.jpeg'
130         );
131
132         $this->assertEquals($act->actor->displayName, 'Test User');
133
134         $poco = $act->actor->poco;
135         $this->assertEquals($poco->preferredUsername, 'testuser');
136         $this->assertEquals($poco->address->formatted, 'San Francisco, CA');
137         $this->assertEquals($poco->urls[0]->type, 'homepage');
138         $this->assertEquals($poco->urls[0]->value, 'http://example.com/blog.html');
139         $this->assertEquals($poco->urls[0]->primary, 'true');
140         $this->assertEquals($act->actor->geopoint, '37.7749295 -122.4194155');
141     }
142
143     public function testExample6()
144     {
145         global $_example6;
146
147         $dom = DOMDocument::loadXML($_example6);
148
149         $rss = $dom->documentElement;
150
151         $channels = $dom->getElementsByTagName('channel');
152
153         $channel = $channels->item(0);
154
155         $items = $channel->getElementsByTagName('item');
156
157         $item = $items->item(0);
158
159         $act = new Activity($item, $channel);
160
161         $this->assertEquals($act->verb, ActivityVerb::POST);
162
163         $this->assertEquals($act->id, 'http://en.blog.wordpress.com/?p=3857');
164         $this->assertEquals($act->link, 'http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/');
165         $this->assertEquals($act->title, 'Rub-a-Dub-Dub in the PubSubHubbub');
166         $this->assertEquals($act->time, 1267634892);
167
168         $actor = $act->actor;
169
170         $this->assertFalse(empty($actor));
171         $this->assertEquals($actor->title, "Joseph Scott");
172     }
173
174     public function testExample7()
175     {
176         global $_example7;
177
178         $dom = DOMDocument::loadXML($_example7);
179
180         $rss = $dom->documentElement;
181
182         $channels = $dom->getElementsByTagName('channel');
183
184         $channel = $channels->item(0);
185
186         $items = $channel->getElementsByTagName('item');
187
188         $item = $items->item(0);
189
190         $act = new Activity($item, $channel);
191
192         $this->assertEquals(ActivityVerb::POST, $act->verb);
193         $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->link);
194         $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->id);
195         $this->assertEquals('Checking out captain bones', $act->title);
196         $this->assertEquals(1269095551, $act->time);
197
198         $actor = $act->actor;
199
200         $this->assertEquals(ActivityObject::PERSON, $actor->type);
201         $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->id);
202         $this->assertEquals('Evan Prodromou', $actor->title);
203         $this->assertNull($actor->summary);
204         $this->assertNull($actor->content);
205         $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->link);
206         $this->assertNull($actor->source);
207         $this->assertTrue(is_array($actor->avatarLinks));
208         $this->assertEquals(1, count($actor->avatarLinks));
209         $this->assertEquals('http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg',
210                             $actor->avatarLinks[0]);
211         $this->assertNotNull($actor->poco);
212         $this->assertEquals('evanpro', $actor->poco->preferredUsername);
213         $this->assertEquals('Evan Prodromou', $actor->poco->displayName);
214         $this->assertNull($actor->poco->note);
215         $this->assertNull($actor->poco->address);
216         $this->assertEquals(0, count($actor->poco->urls));
217     }
218 }
219
220 $_example1 = <<<EXAMPLE1
221 <?xml version='1.0' encoding='UTF-8'?>
222 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
223   <id>tag:versioncentral.example.org,2009:/commit/1643245</id>
224   <published>2009-06-01T12:54:00Z</published>
225   <title>Geraldine committed a change to yate</title>
226   <content type="xhtml">Geraldine just committed a change to yate on VersionCentral</content>
227   <link rel="alternate" type="text/html"
228         href="http://versioncentral.example.org/geraldine/yate/commit/1643245" />
229   <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
230   <activity:verb>http://versioncentral.example.org/activity/commit</activity:verb>
231   <activity:object>
232     <activity:object-type>http://versioncentral.example.org/activity/changeset</activity:object-type>
233     <id>tag:versioncentral.example.org,2009:/change/1643245</id>
234     <title>Punctuation Changeset</title>
235     <summary>Fixing punctuation because it makes it more readable.</summary>
236     <link rel="alternate" type="text/html" href="..." />
237   </activity:object>
238 </entry>
239 EXAMPLE1;
240
241 $_example2 = <<<EXAMPLE2
242 <?xml version='1.0' encoding='UTF-8'?>
243 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
244   <id>tag:photopanic.example.com,2008:activity01</id>
245   <title>Geraldine posted a Photo on PhotoPanic</title>
246   <published>2008-11-02T15:29:00Z</published>
247   <link rel="alternate" type="text/html" href="/geraldine/activities/1" />
248   <activity:verb>
249   http://activitystrea.ms/schema/1.0/post
250   </activity:verb>
251   <activity:object>
252     <id>tag:photopanic.example.com,2008:photo01</id>
253     <title>My Cat</title>
254     <published>2008-11-02T15:29:00Z</published>
255     <link rel="alternate" type="text/html" href="/geraldine/photos/1" />
256     <activity:object-type>
257       tag:atomactivity.example.com,2008:photo
258     </activity:object-type>
259     <source>
260       <title>Geraldine's Photos</title>
261       <link rel="self" type="application/atom+xml" href="/geraldine/photofeed.xml" />
262       <link rel="alternate" type="text/html" href="/geraldine/" />
263     </source>
264   </activity:object>
265   <content type="html">
266      &lt;p&gt;Geraldine posted a Photo on PhotoPanic&lt;/p&gt;
267      &lt;img src="/geraldine/photo1.jpg"&gt;
268   </content>
269 </entry>
270 EXAMPLE2;
271
272 $_example3 = <<<EXAMPLE3
273 <?xml version="1.0" encoding="utf-8"?>
274
275 <feed xmlns="http://www.w3.org/2005/Atom">
276
277     <title>Example Feed</title>
278     <subtitle>A subtitle.</subtitle>
279     <link href="http://example.org/feed/" rel="self" />
280     <link href="http://example.org/" />
281     <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
282     <updated>2003-12-13T18:30:02Z</updated>
283     <author>
284         <name>John Doe</name>
285         <email>johndoe@example.com</email>
286     </author>
287
288     <entry>
289         <title>Atom-Powered Robots Run Amok</title>
290         <link href="http://example.org/2003/12/13/atom03" />
291         <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
292         <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
293         <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
294         <updated>2003-12-13T18:30:02Z</updated>
295         <summary>Some text.</summary>
296     </entry>
297
298 </feed>
299 EXAMPLE3;
300
301 $_example4 = <<<EXAMPLE4
302 <?xml version='1.0' encoding='UTF-8'?>
303 <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">
304  <title>@evan now is the time for all good men to come to the aid of their country. #thetime</title>
305  <summary>@evan now is the time for all good men to come to the aid of their country. #thetime</summary>
306 <author>
307  <name>spock</name>
308  <uri>http://example.net/user/2</uri>
309 </author>
310 <activity:actor>
311  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
312  <id>http://example.net/user/2</id>
313  <title>spock</title>
314  <link type="image/png" rel="avatar" href="http://example.net/theme/identica/default-avatar-profile.png"></link>
315 </activity:actor>
316  <link rel="alternate" type="text/html" href="http://example.net/notice/14"/>
317  <id>http://example.net/notice/14</id>
318  <published>2010-02-19T02:52:38+00:00</published>
319  <updated>2010-02-19T02:52:38+00:00</updated>
320  <link rel="related" href="http://example.net/notice/12"/>
321  <thr:in-reply-to ref="http://example.net/notice/12" href="http://example.net/notice/12"></thr:in-reply-to>
322  <link rel="ostatus:conversation" href="http://example.net/conversation/11"/>
323  <link rel="ostatus:attention" href="http://example.net/user/1"/>
324  <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>
325  <category term="thetime"></category>
326 </entry>
327 EXAMPLE4;
328
329 $_example5 = <<<EXAMPLE5
330 <?xml version="1.0" encoding="UTF-8"?>
331 <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">
332  <id>3</id>
333  <title>testuser timeline</title>
334  <subtitle>Updates from testuser on Zach Dev!</subtitle>
335  <logo>http://example.net/mysite/avatar/3-96-20100224004207.jpeg</logo>
336  <updated>2010-02-24T06:38:49+00:00</updated>
337 <author>
338  <name>testuser</name>
339  <uri>http://example.net/mysite/user/3</uri>
340
341 </author>
342  <link href="http://example.net/mysite/testuser" rel="alternate" type="text/html"/>
343  <link href="http://example.net/mysite/api/statuses/user_timeline/3.atom" rel="self" type="application/atom+xml"/>
344  <link href="http://example.net/mysite/main/sup#3" rel="http://api.friendfeed.com/2008/03#sup" type="application/json"/>
345  <link href="http://example.net/mysite/main/push/hub" rel="hub"/>
346  <link href="http://example.net/mysite/main/salmon/user/3" rel="salmon"/>
347 <activity:subject>
348  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
349  <id>http://example.net/mysite/user/3</id>
350  <title>Test User</title>
351  <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
352  <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
353  <georss:point>37.7749295 -122.4194155</georss:point>
354
355 <poco:preferredUsername>testuser</poco:preferredUsername>
356 <poco:displayName>Test User</poco:displayName>
357 <poco:note>Just another test user.</poco:note>
358 <poco:address>
359  <poco:formatted>San Francisco, CA</poco:formatted>
360 </poco:address>
361 <poco:urls>
362  <poco:type>homepage</poco:type>
363  <poco:value>http://example.com/blog.html</poco:value>
364  <poco:primary>true</poco:primary>
365
366 </poco:urls>
367 </activity:subject>
368 <entry>
369  <title>Hey man, is that Freedom Code?! #freedom #hippy</title>
370  <summary>Hey man, is that Freedom Code?! #freedom #hippy</summary>
371 <author>
372  <name>testuser</name>
373  <uri>http://example.net/mysite/user/3</uri>
374 </author>
375 <activity:actor>
376  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
377  <id>http://example.net/mysite/user/3</id>
378  <title>Test User</title>
379  <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
380  <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
381  <georss:point>37.7749295 -122.4194155</georss:point>
382
383 <poco:preferredUsername>testuser</poco:preferredUsername>
384 <poco:displayName>Test User</poco:displayName>
385 <poco:note>Just another test user.</poco:note>
386 <poco:address>
387  <poco:formatted>San Francisco, CA</poco:formatted>
388 </poco:address>
389 <poco:urls>
390  <poco:type>homepage</poco:type>
391  <poco:value>http://example.com/blog.html</poco:value>
392  <poco:primary>true</poco:primary>
393
394 </poco:urls>
395 </activity:actor>
396  <link rel="alternate" type="text/html" href="http://example.net/mysite/notice/7"/>
397  <id>http://example.net/mysite/notice/7</id>
398  <published>2010-02-24T00:53:06+00:00</published>
399  <updated>2010-02-24T00:53:06+00:00</updated>
400  <link rel="ostatus:conversation" href="http://example.net/mysite/conversation/7"/>
401  <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>
402  <georss:point>37.8313160 -122.2852473</georss:point>
403
404 </entry>
405 </feed>
406 EXAMPLE5;
407
408 $_example6 = <<<EXAMPLE6
409 <?xml version="1.0" encoding="UTF-8"?>
410 <rss version="2.0"
411         xmlns:content="http://purl.org/rss/1.0/modules/content/"
412         xmlns:wfw="http://wellformedweb.org/CommentAPI/"
413         xmlns:dc="http://purl.org/dc/elements/1.1/"
414         xmlns:atom="http://www.w3.org/2005/Atom"
415         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
416         xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
417         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/"
418         >
419
420         <channel>
421                 <title>WordPress.com News</title>
422                 <atom:link href="http://en.blog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
423                 <link>http://en.blog.wordpress.com</link>
424                 <description>The latest news on WordPress.com and the WordPress community.</description>
425                 <lastBuildDate>Thu, 18 Mar 2010 23:25:35 +0000</lastBuildDate>
426
427                 <generator>http://wordpress.com/</generator>
428                 <language>en</language>
429                 <sy:updatePeriod>hourly</sy:updatePeriod>
430                 <sy:updateFrequency>1</sy:updateFrequency>
431                 <cloud domain='en.blog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
432                 <image>
433                         <url>http://www.gravatar.com/blavatar/e6392390e3bcfadff3671c5a5653d95b?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
434                         <title>WordPress.com News</title>
435                         <link>http://en.blog.wordpress.com</link>
436                 </image>
437                 <atom:link rel="search" type="application/opensearchdescription+xml" href="http://en.blog.wordpress.com/osd.xml" title="WordPress.com News" />
438                 <atom:link rel='hub' href='http://en.blog.wordpress.com/?pushpress=hub'/>
439
440                 <item>
441                         <title>Rub-a-Dub-Dub in the PubSubHubbub</title>
442                         <link>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/</link>
443                         <comments>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/#comments</comments>
444                         <pubDate>Wed, 03 Mar 2010 16:48:12 +0000</pubDate>
445                         <dc:creator>Joseph Scott</dc:creator>
446
447                         <category><![CDATA[Feeds]]></category>
448                         <category><![CDATA[atom]]></category>
449                         <category><![CDATA[pubsubhubbub]]></category>
450                         <category><![CDATA[rss]]></category>
451
452                         <guid isPermaLink="false">http://en.blog.wordpress.com/?p=3857</guid>
453                         <description><![CDATA[From the tongue twisting name department we welcome PubSubHubbub, or as some people have shortened it to: PuSH.  Like rssCloud, PuSH is a way for services that subscribe to updates from your blog (think Google Reader, Bloglines or Netvibes) to get updates even faster.  In a nutshell, instead of having to periodically ask [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=en.blog.wordpress.com&blog=3584907&post=3857&subd=en.blog&ref=&feed=1" />]]></description>
454                                 <content:encoded><![CDATA[<p>From the tongue twisting name department we welcome <a href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub</a>, or as some people have shortened it to: PuSH.  Like <a href="http://en.blog.wordpress.com/2009/09/07/rss-in-the-clouds/">rssCloud</a>, PuSH is a way for services that subscribe to updates from your blog (think Google Reader, Bloglines or Netvibes) to get updates even faster.  In a nutshell, instead of having to periodically ask your blog if there are any updates they can now register to automatically receive updates each time you publish new content.  In most cases these updates are sent out within a second or two of when you hit the publish button.</p>
455         <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>
456         <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>
457         <p>For more PuSH related reading check out the <a href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub project site</a> and <a href="http://groups.google.com/group/pubsubhubbub?pli=1">Google Group</a>.  And if you really want to geek out there&#8217;s always the <a href="http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html">PubSubHubbub Spec</a> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
458         <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>
459                                 <wfw:commentRss>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/feed/</wfw:commentRss>
460
461                         <slash:comments>96</slash:comments>
462
463                         <media:content url="http://1.gravatar.com/avatar/582b66ad5ae1b69c7601a990cb9a661a?s=96&#38;d=identicon" medium="image">
464                                 <media:title type="html">josephscott</media:title>
465                         </media:content>
466                 </item>
467         </channel>
468 </rss>
469 EXAMPLE6;
470
471 $_example7 = <<<EXAMPLE7
472 <?xml version="1.0" encoding="UTF-8"?>
473         <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/">
474           <channel>
475             <title>evanpro's posterous</title>
476             <link>http://evanpro.posterous.com</link>
477             <description>Most recent posts at evanpro's posterous</description>
478             <generator>posterous.com</generator>
479             <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"/>
480             <atom:link rel="self" href="http://evanpro.posterous.com/rss.xml"/>
481             <atom:link rel="hub" href="http://posterous.superfeedr.com"/>
482             <item>
483               <pubDate>Sat, 20 Mar 2010 07:32:31 -0700</pubDate>
484               <title>Checking out captain bones</title>
485               <link>http://evanpro.posterous.com/checking-out-captain-bones</link>
486               <guid>http://evanpro.posterous.com/checking-out-captain-bones</guid>
487               <description>
488                 <![CDATA[<p>
489                 <p>Bones!</p>
490
491         </p>
492
493         <p><a href="http://evanpro.posterous.com/checking-out-captain-bones">Permalink</a>
494
495                 | <a href="http://evanpro.posterous.com/checking-out-captain-bones#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>
496
497         </p>]]>
498               </description>
499               <posterous:author>
500                 <posterous:userImage>http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg</posterous:userImage>
501                 <posterous:profileUrl>http://posterous.com/people/3sDslhaepotz</posterous:profileUrl>
502                 <posterous:firstName>Evan</posterous:firstName>
503                 <posterous:lastnNme>Prodromou</posterous:lastnNme>
504                 <posterous:nickName>evanpro</posterous:nickName>
505                 <posterous:displayName>Evan Prodromou</posterous:displayName>
506               </posterous:author>
507             </item>
508         </channel>
509 </rss>
510 EXAMPLE7;