]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/ActivityParseTests.php
Merge branch '0.9.x' into 1.0.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(1243860840, $act->time);
26         $this->assertEquals(ActivityVerb::POST, $act->verb);
27
28         $this->assertFalse(empty($act->objects[0]));
29         $this->assertEquals('Punctuation Changeset', $act->objects[0]->title);
30         $this->assertEquals('http://versioncentral.example.org/activity/changeset', $act->objects[0]->type);
31         $this->assertEquals('Fixing punctuation because it makes it more readable.', $act->objects[0]->summary);
32         $this->assertEquals('tag:versioncentral.example.org,2009:/change/1643245', $act->objects[0]->id);
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(1071340202, $act->time);
50         $this->assertEquals('http://example.org/2003/12/13/atom03.html', $act->link);
51
52         $this->assertEquals($act->verb, ActivityVerb::POST);
53
54         $this->assertFalse(empty($act->actor));
55         $this->assertEquals(ActivityObject::PERSON, $act->actor->type);
56         $this->assertEquals('John Doe', $act->actor->title);
57         $this->assertEquals('mailto:johndoe@example.com', $act->actor->id);
58
59         $this->assertFalse(empty($act->objects[0]));
60         $this->assertEquals(ActivityObject::NOTE, $act->objects[0]->type);
61         $this->assertEquals('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', $act->objects[0]->id);
62         $this->assertEquals('Atom-Powered Robots Run Amok', $act->objects[0]->title);
63         $this->assertEquals('Some text.', $act->objects[0]->summary);
64         $this->assertEquals('http://example.org/2003/12/13/atom03.html', $act->objects[0]->link);
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->objects[0]));
94         $this->assertEquals($act->objects[0]->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]->url);
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     // Media test - cliqset
220     public function testExample8()
221     {
222         global $_example8;
223         $dom = DOMDocument::loadXML($_example8);
224
225         $feed = $dom->documentElement;
226
227         $entries = $feed->getElementsByTagName('entry');
228
229         $entry = $entries->item(0);
230
231         $act = new Activity($entry, $feed);
232
233         $this->assertFalse(empty($act));
234         $this->assertEquals($act->time, 1269221753);
235         $this->assertEquals($act->verb, ActivityVerb::POST);
236         $this->assertEquals($act->summary, 'zcopley posted 5 photos on Flickr');
237
238         $this->assertFalse(empty($act->objects));
239         $this->assertEquals(sizeof($act->objects), 5);
240
241         $this->assertEquals($act->objects[0]->type, ActivityObject::PHOTO);
242         $this->assertEquals($act->objects[0]->title, 'IMG_1368');
243         $this->assertNull($act->objects[0]->description);
244         $this->assertEquals(
245             $act->objects[0]->thumbnail,
246             'http://media.cliqset.com/6f6fbee9d7dfbffc73b6ef626275eb5f_thumb.jpg'
247         );
248         $this->assertEquals(
249             $act->objects[0]->link,
250             'http://www.flickr.com/photos/zcopley/4452933806/'
251         );
252
253         $this->assertEquals($act->objects[1]->type, ActivityObject::PHOTO);
254         $this->assertEquals($act->objects[1]->title, 'IMG_1365');
255         $this->assertNull($act->objects[1]->description);
256         $this->assertEquals(
257             $act->objects[1]->thumbnail,
258             'http://media.cliqset.com/b8f3932cd0bba1b27f7c8b3ef986915e_thumb.jpg'
259         );
260         $this->assertEquals(
261             $act->objects[1]->link,
262             'http://www.flickr.com/photos/zcopley/4442630390/'
263         );
264
265         $this->assertEquals($act->objects[2]->type, ActivityObject::PHOTO);
266         $this->assertEquals($act->objects[2]->title, 'Classic');
267         $this->assertEquals(
268             $act->objects[2]->description,
269             '-Powered by pikchur.com/n0u'
270         );
271         $this->assertEquals(
272             $act->objects[2]->thumbnail,
273             'http://media.cliqset.com/fc54c15f850b7a9a8efa644087a48c91_thumb.jpg'
274         );
275         $this->assertEquals(
276             $act->objects[2]->link,
277             'http://www.flickr.com/photos/zcopley/4430754103/'
278         );
279
280         $this->assertEquals($act->objects[3]->type, ActivityObject::PHOTO);
281         $this->assertEquals($act->objects[3]->title, 'IMG_1363');
282         $this->assertNull($act->objects[3]->description);
283
284         $this->assertEquals(
285             $act->objects[3]->thumbnail,
286             'http://media.cliqset.com/4b1d307c9217e2114391a8b229d612cb_thumb.jpg'
287         );
288         $this->assertEquals(
289             $act->objects[3]->link,
290             'http://www.flickr.com/photos/zcopley/4416969717/'
291         );
292
293         $this->assertEquals($act->objects[4]->type, ActivityObject::PHOTO);
294         $this->assertEquals($act->objects[4]->title, 'IMG_1361');
295         $this->assertNull($act->objects[4]->description);
296
297         $this->assertEquals(
298             $act->objects[4]->thumbnail,
299             'http://media.cliqset.com/23d9b4b96b286e0347d36052f22f6e60_thumb.jpg'
300         );
301         $this->assertEquals(
302             $act->objects[4]->link,
303             'http://www.flickr.com/photos/zcopley/4417734232/'
304         );
305
306     }
307
308 }
309
310 $_example1 = <<<EXAMPLE1
311 <?xml version='1.0' encoding='UTF-8'?>
312 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
313   <id>tag:versioncentral.example.org,2009:/commit/1643245</id>
314   <published>2009-06-01T12:54:00Z</published>
315   <title>Geraldine committed a change to yate</title>
316   <content type="xhtml">Geraldine just committed a change to yate on VersionCentral</content>
317   <link rel="alternate" type="text/html"
318         href="http://versioncentral.example.org/geraldine/yate/commit/1643245" />
319   <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
320   <activity:verb>http://versioncentral.example.org/activity/commit</activity:verb>
321   <activity:object>
322     <activity:object-type>http://versioncentral.example.org/activity/changeset</activity:object-type>
323     <id>tag:versioncentral.example.org,2009:/change/1643245</id>
324     <title>Punctuation Changeset</title>
325     <summary>Fixing punctuation because it makes it more readable.</summary>
326     <link rel="alternate" type="text/html" href="..." />
327   </activity:object>
328 </entry>
329 EXAMPLE1;
330
331 $_example2 = <<<EXAMPLE2
332 <?xml version='1.0' encoding='UTF-8'?>
333 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
334   <id>tag:photopanic.example.com,2008:activity01</id>
335   <title>Geraldine posted a Photo on PhotoPanic</title>
336   <published>2008-11-02T15:29:00Z</published>
337   <link rel="alternate" type="text/html" href="/geraldine/activities/1" />
338   <activity:verb>
339   http://activitystrea.ms/schema/1.0/post
340   </activity:verb>
341   <activity:object>
342     <id>tag:photopanic.example.com,2008:photo01</id>
343     <title>My Cat</title>
344     <published>2008-11-02T15:29:00Z</published>
345     <link rel="alternate" type="text/html" href="/geraldine/photos/1" />
346     <activity:object-type>
347       tag:atomactivity.example.com,2008:photo
348     </activity:object-type>
349     <source>
350       <title>Geraldine's Photos</title>
351       <link rel="self" type="application/atom+xml" href="/geraldine/photofeed.xml" />
352       <link rel="alternate" type="text/html" href="/geraldine/" />
353     </source>
354   </activity:object>
355   <content type="html">
356      &lt;p&gt;Geraldine posted a Photo on PhotoPanic&lt;/p&gt;
357      &lt;img src="/geraldine/photo1.jpg"&gt;
358   </content>
359 </entry>
360 EXAMPLE2;
361
362 $_example3 = <<<EXAMPLE3
363 <?xml version="1.0" encoding="utf-8"?>
364
365 <feed xmlns="http://www.w3.org/2005/Atom">
366
367     <title>Example Feed</title>
368     <subtitle>A subtitle.</subtitle>
369     <link href="http://example.org/feed/" rel="self" />
370     <link href="http://example.org/" />
371     <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
372     <updated>2003-12-13T18:30:02Z</updated>
373     <author>
374         <name>John Doe</name>
375         <email>johndoe@example.com</email>
376     </author>
377
378     <entry>
379         <title>Atom-Powered Robots Run Amok</title>
380         <link href="http://example.org/2003/12/13/atom03" />
381         <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
382         <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
383         <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
384         <updated>2003-12-13T18:30:02Z</updated>
385         <summary>Some text.</summary>
386     </entry>
387
388 </feed>
389 EXAMPLE3;
390
391 $_example4 = <<<EXAMPLE4
392 <?xml version='1.0' encoding='UTF-8'?>
393 <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">
394  <title>@evan now is the time for all good men to come to the aid of their country. #thetime</title>
395  <summary>@evan now is the time for all good men to come to the aid of their country. #thetime</summary>
396 <author>
397  <name>spock</name>
398  <uri>http://example.net/user/2</uri>
399 </author>
400 <activity:actor>
401  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
402  <id>http://example.net/user/2</id>
403  <title>spock</title>
404  <link type="image/png" rel="avatar" href="http://example.net/theme/identica/default-avatar-profile.png"></link>
405 </activity:actor>
406  <link rel="alternate" type="text/html" href="http://example.net/notice/14"/>
407  <id>http://example.net/notice/14</id>
408  <published>2010-02-19T02:52:38+00:00</published>
409  <updated>2010-02-19T02:52:38+00:00</updated>
410  <link rel="related" href="http://example.net/notice/12"/>
411  <thr:in-reply-to ref="http://example.net/notice/12" href="http://example.net/notice/12"></thr:in-reply-to>
412  <link rel="ostatus:conversation" href="http://example.net/conversation/11"/>
413  <link rel="ostatus:attention" href="http://example.net/user/1"/>
414  <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>
415  <category term="thetime"></category>
416 </entry>
417 EXAMPLE4;
418
419 $_example5 = <<<EXAMPLE5
420 <?xml version="1.0" encoding="UTF-8"?>
421 <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">
422  <id>3</id>
423  <title>testuser timeline</title>
424  <subtitle>Updates from testuser on Zach Dev!</subtitle>
425  <logo>http://example.net/mysite/avatar/3-96-20100224004207.jpeg</logo>
426  <updated>2010-02-24T06:38:49+00:00</updated>
427 <author>
428  <name>testuser</name>
429  <uri>http://example.net/mysite/user/3</uri>
430
431 </author>
432  <link href="http://example.net/mysite/testuser" rel="alternate" type="text/html"/>
433  <link href="http://example.net/mysite/api/statuses/user_timeline/3.atom" rel="self" type="application/atom+xml"/>
434  <link href="http://example.net/mysite/main/sup#3" rel="http://api.friendfeed.com/2008/03#sup" type="application/json"/>
435  <link href="http://example.net/mysite/main/push/hub" rel="hub"/>
436  <link href="http://example.net/mysite/main/salmon/user/3" rel="salmon"/>
437 <activity:subject>
438  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
439  <id>http://example.net/mysite/user/3</id>
440  <title>Test User</title>
441  <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
442  <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
443  <georss:point>37.7749295 -122.4194155</georss:point>
444
445 <poco:preferredUsername>testuser</poco:preferredUsername>
446 <poco:displayName>Test User</poco:displayName>
447 <poco:note>Just another test user.</poco:note>
448 <poco:address>
449  <poco:formatted>San Francisco, CA</poco:formatted>
450 </poco:address>
451 <poco:urls>
452  <poco:type>homepage</poco:type>
453  <poco:value>http://example.com/blog.html</poco:value>
454  <poco:primary>true</poco:primary>
455
456 </poco:urls>
457 </activity:subject>
458 <entry>
459  <title>Hey man, is that Freedom Code?! #freedom #hippy</title>
460  <summary>Hey man, is that Freedom Code?! #freedom #hippy</summary>
461 <author>
462  <name>testuser</name>
463  <uri>http://example.net/mysite/user/3</uri>
464 </author>
465 <activity:actor>
466  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
467  <id>http://example.net/mysite/user/3</id>
468  <title>Test User</title>
469  <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
470  <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
471  <georss:point>37.7749295 -122.4194155</georss:point>
472
473 <poco:preferredUsername>testuser</poco:preferredUsername>
474 <poco:displayName>Test User</poco:displayName>
475 <poco:note>Just another test user.</poco:note>
476 <poco:address>
477  <poco:formatted>San Francisco, CA</poco:formatted>
478 </poco:address>
479 <poco:urls>
480  <poco:type>homepage</poco:type>
481  <poco:value>http://example.com/blog.html</poco:value>
482  <poco:primary>true</poco:primary>
483
484 </poco:urls>
485 </activity:actor>
486  <link rel="alternate" type="text/html" href="http://example.net/mysite/notice/7"/>
487  <id>http://example.net/mysite/notice/7</id>
488  <published>2010-02-24T00:53:06+00:00</published>
489  <updated>2010-02-24T00:53:06+00:00</updated>
490  <link rel="ostatus:conversation" href="http://example.net/mysite/conversation/7"/>
491  <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>
492  <georss:point>37.8313160 -122.2852473</georss:point>
493
494 </entry>
495 </feed>
496 EXAMPLE5;
497
498 $_example6 = <<<EXAMPLE6
499 <?xml version="1.0" encoding="UTF-8"?>
500 <rss version="2.0"
501         xmlns:content="http://purl.org/rss/1.0/modules/content/"
502         xmlns:wfw="http://wellformedweb.org/CommentAPI/"
503         xmlns:dc="http://purl.org/dc/elements/1.1/"
504         xmlns:atom="http://www.w3.org/2005/Atom"
505         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
506         xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
507         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/"
508         >
509
510         <channel>
511                 <title>WordPress.com News</title>
512                 <atom:link href="http://en.blog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
513                 <link>http://en.blog.wordpress.com</link>
514                 <description>The latest news on WordPress.com and the WordPress community.</description>
515                 <lastBuildDate>Thu, 18 Mar 2010 23:25:35 +0000</lastBuildDate>
516
517                 <generator>http://wordpress.com/</generator>
518                 <language>en</language>
519                 <sy:updatePeriod>hourly</sy:updatePeriod>
520                 <sy:updateFrequency>1</sy:updateFrequency>
521                 <cloud domain='en.blog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
522                 <image>
523                         <url>http://www.gravatar.com/blavatar/e6392390e3bcfadff3671c5a5653d95b?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
524                         <title>WordPress.com News</title>
525                         <link>http://en.blog.wordpress.com</link>
526                 </image>
527                 <atom:link rel="search" type="application/opensearchdescription+xml" href="http://en.blog.wordpress.com/osd.xml" title="WordPress.com News" />
528                 <atom:link rel='hub' href='http://en.blog.wordpress.com/?pushpress=hub'/>
529
530                 <item>
531                         <title>Rub-a-Dub-Dub in the PubSubHubbub</title>
532                         <link>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/</link>
533                         <comments>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/#comments</comments>
534                         <pubDate>Wed, 03 Mar 2010 16:48:12 +0000</pubDate>
535                         <dc:creator>Joseph Scott</dc:creator>
536
537                         <category><![CDATA[Feeds]]></category>
538                         <category><![CDATA[atom]]></category>
539                         <category><![CDATA[pubsubhubbub]]></category>
540                         <category><![CDATA[rss]]></category>
541
542                         <guid isPermaLink="false">http://en.blog.wordpress.com/?p=3857</guid>
543                         <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>
544                                 <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>
545         <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>
546         <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>
547         <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>
548         <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>
549                                 <wfw:commentRss>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/feed/</wfw:commentRss>
550
551                         <slash:comments>96</slash:comments>
552
553                         <media:content url="http://1.gravatar.com/avatar/582b66ad5ae1b69c7601a990cb9a661a?s=96&#38;d=identicon" medium="image">
554                                 <media:title type="html">josephscott</media:title>
555                         </media:content>
556                 </item>
557         </channel>
558 </rss>
559 EXAMPLE6;
560
561 $_example7 = <<<EXAMPLE7
562 <?xml version="1.0" encoding="UTF-8"?>
563         <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/">
564           <channel>
565             <title>evanpro's posterous</title>
566             <link>http://evanpro.posterous.com</link>
567             <description>Most recent posts at evanpro's posterous</description>
568             <generator>posterous.com</generator>
569             <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"/>
570             <atom:link rel="self" href="http://evanpro.posterous.com/rss.xml"/>
571             <atom:link rel="hub" href="http://posterous.superfeedr.com"/>
572             <item>
573               <pubDate>Sat, 20 Mar 2010 07:32:31 -0700</pubDate>
574               <title>Checking out captain bones</title>
575               <link>http://evanpro.posterous.com/checking-out-captain-bones</link>
576               <guid>http://evanpro.posterous.com/checking-out-captain-bones</guid>
577               <description>
578                 <![CDATA[<p>
579                 <p>Bones!</p>
580
581         </p>
582
583         <p><a href="http://evanpro.posterous.com/checking-out-captain-bones">Permalink</a>
584
585                 | <a href="http://evanpro.posterous.com/checking-out-captain-bones#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>
586
587         </p>]]>
588               </description>
589               <posterous:author>
590                 <posterous:userImage>http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg</posterous:userImage>
591                 <posterous:profileUrl>http://posterous.com/people/3sDslhaepotz</posterous:profileUrl>
592                 <posterous:firstName>Evan</posterous:firstName>
593                 <posterous:lastnNme>Prodromou</posterous:lastnNme>
594                 <posterous:nickName>evanpro</posterous:nickName>
595                 <posterous:displayName>Evan Prodromou</posterous:displayName>
596               </posterous:author>
597             </item>
598         </channel>
599 </rss>
600 EXAMPLE7;
601
602 $_example8 = <<<EXAMPLE8
603 <?xml version="1.0"?>
604 <feed xmlns="http://www.w3.org/2005/Atom">
605     <link href="http://pubsubhubbub.appspot.com/" rel="hub"/>
606     <title type="text">Activity Stream for: zcopley</title>
607     <id>http://cliqset.com/feed/atom?uid=zcopley</id>
608     <entry xmlns:service="http://activitystrea.ms/service-provider" xmlns:activity="http://activitystrea.ms/spec/1.0/">
609         <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total>
610         <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
611         <published>2010-03-22T01:35:53.000Z</published>
612         <service:provider>
613             <name>flickr</name>
614             <uri>http://flickr.com</uri>
615             <icon>http://cliqset-services.s3.amazonaws.com/flickr.png</icon>
616         </service:provider>
617         <activity:object>
618             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
619             <title type="text">IMG_1368</title>
620             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/6f6fbee9d7dfbffc73b6ef626275eb5f_thumb.jpg"/>
621             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4452933806/"/>
622         </activity:object>
623         <activity:object>
624             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
625             <title type="text">IMG_1365</title>
626             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/b8f3932cd0bba1b27f7c8b3ef986915e_thumb.jpg"/>
627             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4442630390/"/>
628         </activity:object>
629         <activity:object xmlns:media="http://purl.org/syndication/atommedia">
630             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
631             <title type="text">Classic</title>
632             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/fc54c15f850b7a9a8efa644087a48c91_thumb.jpg"/>
633             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4430754103/"/>
634             <media:description type="text">-Powered by pikchur.com/n0u</media:description>
635         </activity:object>
636         <activity:object>
637             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
638             <title type="text">IMG_1363</title>
639             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/4b1d307c9217e2114391a8b229d612cb_thumb.jpg"/>
640             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4416969717/"/>
641         </activity:object>
642         <activity:object>
643             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
644             <title type="text">IMG_1361</title>
645             <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/23d9b4b96b286e0347d36052f22f6e60_thumb.jpg"/>
646             <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4417734232/"/>
647         </activity:object>
648         <title type="text">zcopley posted some photos on Flickr</title>
649         <summary type="text">zcopley posted 5 photos on Flickr</summary>
650         <category scheme="http://schemas.cliqset.com/activity/categories/1.0" term="PhotoPosted" label="Photo Posted"/>
651         <updated>2010-03-22T20:46:42.778Z</updated>
652         <id>tag:cliqset.com,2010-03-22:/user/zcopley/SVgAZubGhtAnSAee</id>
653         <link href="http://cliqset.com/user/zcopley/SVgAZubGhtAnSAee" type="text/xhtml" rel="alternate" title="zcopley posted some photos on Flickr"/>
654         <author>
655             <name>zcopley</name>
656             <uri>http://cliqset.com/user/zcopley</uri>
657         </author>
658         <activity:actor xmlns:poco="http://portablecontacts.net/spec/1.0">
659             <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
660             <id>zcopley</id>
661             <poco:name>
662                 <poco:givenName>Zach</poco:givenName>
663                 <poco:familyName>Copley</poco:familyName>
664             </poco:name>
665             <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"/>
666             <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"/>
667             <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"/>
668         </activity:actor>
669     </entry>
670 </feed>
671 EXAMPLE8;
672
673 $_example9 = <<<EXAMPLE9
674 <?xml version="1.0" encoding="utf-8"?>
675 <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/">
676     <link rel="self" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/117848251937215158042/public/posted"/>
677     <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
678     <title type="text">Google Buzz</title>
679     <updated>2010-03-22T01:55:53.596Z</updated>
680     <id>tag:google.com,2009:buzz-feed/public/posted/117848251937215158042</id>
681     <generator>Google - Google Buzz</generator>
682     <entry>
683         <title type="html">Buzz by Zach Copley from Flickr</title>
684         <summary type="text">IMG_1366</summary>
685         <published>2010-03-18T04:29:23.000Z</published>
686         <updated>2010-03-18T05:14:03.325Z</updated>
687         <id>tag:google.com,2009:buzz/z12zwdhxowq2d13q204cjr04kzu0cns5gh0</id>
688         <link rel="alternate" type="text/html" href="http://www.google.com/buzz/117848251937215158042/ZU7b6mHJEmC/IMG-1366"/>
689         <author>
690             <name>Zach Copley</name>
691             <uri>http://www.google.com/profiles/zcopley</uri>
692         </author>
693         <content type="html">&lt;div&gt;IMG_1366&lt;/div&gt;</content>
694         <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" title="IMG_1366"/>
695         <media:content url="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" medium="image">
696             <media:title>IMG_1366</media:title>
697             <media:player url="http://farm5.static.flickr.com/4053/4442630700_980b19a1a6_o.jpg" height="1600" width="1200"/>
698         </media:content>
699         <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" title="IMG_1365"/>
700         <media:content url="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" medium="image">
701             <media:title>IMG_1365</media:title>
702             <media:player url="http://farm5.static.flickr.com/4043/4442630390_62da5560ae_o.jpg" height="1200" width="1600"/>
703         </media:content>
704         <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
705         <activity:object>
706             <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
707             <id>tag:google.com,2009:buzz/z12zwdhxowq2d13q204cjr04kzu0cns5gh0</id>
708             <title>Buzz by Zach Copley from Flickr</title>
709             <content type="html">&lt;div&gt;IMG_1366&lt;/div&gt;</content>
710             <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" title="IMG_1366"/>
711             <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" title="IMG_1365"/>
712         </activity:object>
713         <link rel="replies" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/117848251937215158042/comments/z12zwdhxowq2d13q204cjr04kzu0cns5gh0" thr:count="0"/>
714         <thr:total>0</thr:total>
715     </entry>
716 </feed>
717 EXAMPLE9;