3 if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
4 print "This script must be run from the command line\n";
8 // XXX: we should probably have some common source for this stuff
10 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
11 define('STATUSNET', true);
13 require_once INSTALLDIR . '/lib/common.php';
15 class ActivityParseTests extends PHPUnit_Framework_TestCase
17 public function testExample1()
20 $dom = DOMDocument::loadXML($_example1);
21 $act = new Activity($dom->documentElement);
23 $this->assertFalse(empty($act));
25 $this->assertEquals(1243860840, $act->time);
26 $this->assertEquals(ActivityVerb::POST, $act->verb);
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);
35 public function testExample2()
38 $dom = DOMDocument::loadXML($_example2);
39 $act = new Activity($dom->documentElement);
41 $this->assertFalse(empty($act));
42 // Did we handle <content type="html"> correctly with a typical payload?
43 $this->assertEquals("<p>Geraldine posted a Photo on PhotoPanic</p>\n " .
44 "<img src=\"/geraldine/photo1.jpg\">", trim($act->content));
47 public function testExample3()
50 $dom = DOMDocument::loadXML($_example3);
52 $feed = $dom->documentElement;
54 $entries = $feed->getElementsByTagName('entry');
56 $entry = $entries->item(0);
58 $act = new Activity($entry, $feed);
60 $this->assertFalse(empty($act));
61 $this->assertEquals(1071340202, $act->time);
62 $this->assertEquals('http://example.org/2003/12/13/atom03.html', $act->link);
64 $this->assertEquals($act->verb, ActivityVerb::POST);
66 $this->assertFalse(empty($act->actor));
67 $this->assertEquals(ActivityObject::PERSON, $act->actor->type);
68 $this->assertEquals('John Doe', $act->actor->title);
69 $this->assertEquals('mailto:johndoe@example.com', $act->actor->id);
71 $this->assertFalse(empty($act->objects[0]));
72 $this->assertEquals(ActivityObject::NOTE, $act->objects[0]->type);
73 $this->assertEquals('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', $act->objects[0]->id);
74 $this->assertEquals('Atom-Powered Robots Run Amok', $act->objects[0]->title);
75 $this->assertEquals('Some text.', $act->objects[0]->summary);
76 $this->assertEquals('http://example.org/2003/12/13/atom03.html', $act->objects[0]->link);
78 $this->assertFalse(empty($act->context));
80 $this->assertTrue(empty($act->target));
82 $this->assertEquals($act->entry, $entry);
83 $this->assertEquals($act->feed, $feed);
86 public function testExample4()
89 $dom = DOMDocument::loadXML($_example4);
91 $entry = $dom->documentElement;
93 $act = new Activity($entry);
95 $this->assertFalse(empty($act));
96 $this->assertEquals(1266547958, $act->time);
97 $this->assertEquals('http://example.net/notice/14', $act->link);
99 $this->assertFalse(empty($act->context));
100 $this->assertEquals('http://example.net/notice/12', $act->context->replyToID);
101 $this->assertEquals('http://example.net/notice/12', $act->context->replyToUrl);
102 $this->assertEquals('http://example.net/conversation/11', $act->context->conversation);
103 $this->assertEquals(array('http://example.net/user/1'), $act->context->attention);
105 $this->assertFalse(empty($act->objects[0]));
106 $this->assertEquals($act->objects[0]->content,
107 '@<span class="vcard"><a href="http://example.net/user/1" class="url"><span class="fn nickname">evan</span></a></span> now is the time for all good men to come to the aid of their country. #<span class="tag"><a href="http://example.net/tag/thetime" rel="tag">thetime</a></span>');
109 $this->assertFalse(empty($act->actor));
112 public function testExample5()
115 $dom = DOMDocument::loadXML($_example5);
117 $feed = $dom->documentElement;
119 // @todo Test feed elements
121 $entries = $feed->getElementsByTagName('entry');
122 $entry = $entries->item(0);
124 $act = new Activity($entry, $feed);
127 $this->assertEquals($act->verb, ActivityVerb::POST);
128 $this->assertFalse(empty($act->context));
130 // Actor w/Portable Contacts stuff
131 $this->assertFalse(empty($act->actor));
132 $this->assertEquals($act->actor->type, ActivityObject::PERSON);
133 $this->assertEquals($act->actor->title, 'Test User');
134 $this->assertEquals($act->actor->id, 'http://example.net/mysite/user/3');
135 $this->assertEquals($act->actor->link, 'http://example.net/mysite/testuser');
137 $avatars = $act->actor->avatarLinks;
141 'http://example.net/mysite/avatar/3-96-20100224004207.jpeg'
144 $this->assertEquals($act->actor->displayName, 'Test User');
146 $poco = $act->actor->poco;
147 $this->assertEquals($poco->preferredUsername, 'testuser');
148 $this->assertEquals($poco->address->formatted, 'San Francisco, CA');
149 $this->assertEquals($poco->urls[0]->type, 'homepage');
150 $this->assertEquals($poco->urls[0]->value, 'http://example.com/blog.html');
151 $this->assertEquals($poco->urls[0]->primary, 'true');
152 $this->assertEquals($act->actor->geopoint, '37.7749295 -122.4194155');
155 public function testExample6()
159 $dom = DOMDocument::loadXML($_example6);
161 $rss = $dom->documentElement;
163 $channels = $dom->getElementsByTagName('channel');
165 $channel = $channels->item(0);
167 $items = $channel->getElementsByTagName('item');
169 $item = $items->item(0);
171 $act = new Activity($item, $channel);
173 $this->assertEquals($act->verb, ActivityVerb::POST);
175 $this->assertEquals($act->id, 'http://en.blog.wordpress.com/?p=3857');
176 $this->assertEquals($act->link, 'http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/');
177 $this->assertEquals($act->title, 'Rub-a-Dub-Dub in the PubSubHubbub');
178 $this->assertEquals($act->time, 1267634892);
180 $actor = $act->actor;
182 $this->assertFalse(empty($actor));
183 $this->assertEquals($actor->title, "Joseph Scott");
186 public function testExample7()
190 $dom = DOMDocument::loadXML($_example7);
192 $rss = $dom->documentElement;
194 $channels = $dom->getElementsByTagName('channel');
196 $channel = $channels->item(0);
198 $items = $channel->getElementsByTagName('item');
200 $item = $items->item(0);
202 $act = new Activity($item, $channel);
204 $this->assertEquals(ActivityVerb::POST, $act->verb);
205 $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->link);
206 $this->assertEquals('http://evanpro.posterous.com/checking-out-captain-bones', $act->id);
207 $this->assertEquals('Checking out captain bones', $act->title);
208 $this->assertEquals(1269095551, $act->time);
210 $actor = $act->actor;
212 $this->assertEquals(ActivityObject::PERSON, $actor->type);
213 $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->id);
214 $this->assertEquals('Evan Prodromou', $actor->title);
215 $this->assertNull($actor->summary);
216 $this->assertNull($actor->content);
217 $this->assertEquals('http://posterous.com/people/3sDslhaepotz', $actor->link);
218 $this->assertNull($actor->source);
219 $this->assertTrue(is_array($actor->avatarLinks));
220 $this->assertEquals(1, count($actor->avatarLinks));
221 $this->assertEquals('http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg',
222 $actor->avatarLinks[0]->url);
223 $this->assertNotNull($actor->poco);
224 $this->assertEquals('evanpro', $actor->poco->preferredUsername);
225 $this->assertEquals('Evan Prodromou', $actor->poco->displayName);
226 $this->assertNull($actor->poco->note);
227 $this->assertNull($actor->poco->address);
228 $this->assertEquals(0, count($actor->poco->urls));
231 // Media test - cliqset
232 public function testExample8()
235 $dom = DOMDocument::loadXML($_example8);
237 $feed = $dom->documentElement;
239 $entries = $feed->getElementsByTagName('entry');
241 $entry = $entries->item(0);
243 $act = new Activity($entry, $feed);
245 $this->assertFalse(empty($act));
246 $this->assertEquals($act->time, 1269221753);
247 $this->assertEquals($act->verb, ActivityVerb::POST);
248 $this->assertEquals($act->summary, 'zcopley posted 5 photos on Flickr');
250 $this->assertFalse(empty($act->objects));
251 $this->assertEquals(sizeof($act->objects), 5);
253 $this->assertEquals($act->objects[0]->type, ActivityObject::PHOTO);
254 $this->assertEquals($act->objects[0]->title, 'IMG_1368');
255 $this->assertNull($act->objects[0]->description);
257 $act->objects[0]->thumbnail,
258 'http://media.cliqset.com/6f6fbee9d7dfbffc73b6ef626275eb5f_thumb.jpg'
261 $act->objects[0]->link,
262 'http://www.flickr.com/photos/zcopley/4452933806/'
265 $this->assertEquals($act->objects[1]->type, ActivityObject::PHOTO);
266 $this->assertEquals($act->objects[1]->title, 'IMG_1365');
267 $this->assertNull($act->objects[1]->description);
269 $act->objects[1]->thumbnail,
270 'http://media.cliqset.com/b8f3932cd0bba1b27f7c8b3ef986915e_thumb.jpg'
273 $act->objects[1]->link,
274 'http://www.flickr.com/photos/zcopley/4442630390/'
277 $this->assertEquals($act->objects[2]->type, ActivityObject::PHOTO);
278 $this->assertEquals($act->objects[2]->title, 'Classic');
280 $act->objects[2]->description,
281 '-Powered by pikchur.com/n0u'
284 $act->objects[2]->thumbnail,
285 'http://media.cliqset.com/fc54c15f850b7a9a8efa644087a48c91_thumb.jpg'
288 $act->objects[2]->link,
289 'http://www.flickr.com/photos/zcopley/4430754103/'
292 $this->assertEquals($act->objects[3]->type, ActivityObject::PHOTO);
293 $this->assertEquals($act->objects[3]->title, 'IMG_1363');
294 $this->assertNull($act->objects[3]->description);
297 $act->objects[3]->thumbnail,
298 'http://media.cliqset.com/4b1d307c9217e2114391a8b229d612cb_thumb.jpg'
301 $act->objects[3]->link,
302 'http://www.flickr.com/photos/zcopley/4416969717/'
305 $this->assertEquals($act->objects[4]->type, ActivityObject::PHOTO);
306 $this->assertEquals($act->objects[4]->title, 'IMG_1361');
307 $this->assertNull($act->objects[4]->description);
310 $act->objects[4]->thumbnail,
311 'http://media.cliqset.com/23d9b4b96b286e0347d36052f22f6e60_thumb.jpg'
314 $act->objects[4]->link,
315 'http://www.flickr.com/photos/zcopley/4417734232/'
320 public function testAtomContent()
322 $tests = array(array("<content>Some regular plain text.</content>",
323 "Some regular plain text."),
324 array("<content><b>this is not HTML</b></content>",
325 "<b>this is not HTML</b>"),
326 array("<content type='html'>Some regular plain HTML.</content>",
327 "Some regular plain HTML."),
328 array("<content type='html'><b>this is too HTML</b></content>",
329 "<b>this is too HTML</b>"),
330 array("<content type='html'>&lt;b&gt;but this is not HTML!&lt;/b&gt;</content>",
331 "<b>but this is not HTML!</b>"),
332 array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Some regular plain XHTML.</div></content>",
333 "Some regular plain XHTML."),
334 array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'><b>This is some XHTML!</b></div></content>",
335 "<b>This is some XHTML!</b>"),
336 array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'><b>This is not some XHTML!</b></div></content>",
337 "<b>This is not some XHTML!</b>"),
338 array("<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>&lt;b&gt;This is not some XHTML either!&lt;/b&gt;</div></content>",
339 "&lt;b&gt;This is not some XHTML either!&lt;/b&gt;"));
340 foreach ($tests as $data) {
341 list($source, $output) = $data;
342 $xml = "<entry xmlns='http://www.w3.org/2005/Atom'>" .
343 "<id>http://example.com/fakeid</id>" .
344 "<author><name>Test</name></author>" .
345 "<title>Atom content tests</title>" .
348 $dom = DOMDocument::loadXML($xml);
349 $act = new Activity($dom->documentElement);
351 $this->assertFalse(empty($act));
352 $this->assertEquals($output, trim($act->content));
356 public function testRssContent()
358 $tests = array(array("<content:encoded>Some regular plain HTML.</content:encoded>",
359 "Some regular plain HTML."),
360 array("<content:encoded>Some <b>exciting bold HTML</b></content:encoded>",
361 "Some <b>exciting bold HTML</b>"),
362 array("<content:encoded>Some &lt;b&gt;escaped non-HTML.&lt;/b&gt;</content:encoded>",
363 "Some <b>escaped non-HTML.</b>"),
364 array("<description>Some plain text.</description>",
366 array("<description>Some <b>non-HTML text</b></description>",
367 "Some <b>non-HTML text</b>"),
368 array("<description>Some &lt;b&gt;double-escaped text&lt;/b&gt;</description>",
369 "Some &lt;b&gt;double-escaped text&lt;/b&gt;"));
370 foreach ($tests as $data) {
371 list($source, $output) = $data;
372 $xml = "<item xmlns:content='http://purl.org/rss/1.0/modules/content/'>" .
373 "<guid>http://example.com/fakeid</guid>" .
374 "<title>RSS content tests</title>" .
377 $dom = DOMDocument::loadXML($xml);
378 $act = new Activity($dom->documentElement);
380 $this->assertFalse(empty($act));
381 $this->assertEquals($output, trim($act->content));
387 $_example1 = <<<EXAMPLE1
388 <?xml version='1.0' encoding='UTF-8'?>
389 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
390 <id>tag:versioncentral.example.org,2009:/commit/1643245</id>
391 <published>2009-06-01T12:54:00Z</published>
392 <title>Geraldine committed a change to yate</title>
393 <content type="xhtml">Geraldine just committed a change to yate on VersionCentral</content>
394 <link rel="alternate" type="text/html"
395 href="http://versioncentral.example.org/geraldine/yate/commit/1643245" />
396 <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
397 <activity:verb>http://versioncentral.example.org/activity/commit</activity:verb>
399 <activity:object-type>http://versioncentral.example.org/activity/changeset</activity:object-type>
400 <id>tag:versioncentral.example.org,2009:/change/1643245</id>
401 <title>Punctuation Changeset</title>
402 <summary>Fixing punctuation because it makes it more readable.</summary>
403 <link rel="alternate" type="text/html" href="..." />
408 $_example2 = <<<EXAMPLE2
409 <?xml version='1.0' encoding='UTF-8'?>
410 <entry xmlns='http://www.w3.org/2005/Atom' xmlns:activity='http://activitystrea.ms/spec/1.0/'>
411 <id>tag:photopanic.example.com,2008:activity01</id>
412 <title>Geraldine posted a Photo on PhotoPanic</title>
413 <published>2008-11-02T15:29:00Z</published>
414 <link rel="alternate" type="text/html" href="/geraldine/activities/1" />
416 http://activitystrea.ms/schema/1.0/post
419 <id>tag:photopanic.example.com,2008:photo01</id>
420 <title>My Cat</title>
421 <published>2008-11-02T15:29:00Z</published>
422 <link rel="alternate" type="text/html" href="/geraldine/photos/1" />
423 <activity:object-type>
424 tag:atomactivity.example.com,2008:photo
425 </activity:object-type>
427 <title>Geraldine's Photos</title>
428 <link rel="self" type="application/atom+xml" href="/geraldine/photofeed.xml" />
429 <link rel="alternate" type="text/html" href="/geraldine/" />
432 <content type="html">
433 <p>Geraldine posted a Photo on PhotoPanic</p>
434 <img src="/geraldine/photo1.jpg">
439 $_example3 = <<<EXAMPLE3
440 <?xml version="1.0" encoding="utf-8"?>
442 <feed xmlns="http://www.w3.org/2005/Atom">
444 <title>Example Feed</title>
445 <subtitle>A subtitle.</subtitle>
446 <link href="http://example.org/feed/" rel="self" />
447 <link href="http://example.org/" />
448 <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
449 <updated>2003-12-13T18:30:02Z</updated>
451 <name>John Doe</name>
452 <email>johndoe@example.com</email>
456 <title>Atom-Powered Robots Run Amok</title>
457 <link href="http://example.org/2003/12/13/atom03" />
458 <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
459 <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
460 <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
461 <updated>2003-12-13T18:30:02Z</updated>
462 <summary>Some text.</summary>
468 $_example4 = <<<EXAMPLE4
469 <?xml version='1.0' encoding='UTF-8'?>
470 <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">
471 <title>@evan now is the time for all good men to come to the aid of their country. #thetime</title>
472 <summary>@evan now is the time for all good men to come to the aid of their country. #thetime</summary>
475 <uri>http://example.net/user/2</uri>
478 <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
479 <id>http://example.net/user/2</id>
481 <link type="image/png" rel="avatar" href="http://example.net/theme/identica/default-avatar-profile.png"></link>
483 <link rel="alternate" type="text/html" href="http://example.net/notice/14"/>
484 <id>http://example.net/notice/14</id>
485 <published>2010-02-19T02:52:38+00:00</published>
486 <updated>2010-02-19T02:52:38+00:00</updated>
487 <link rel="related" href="http://example.net/notice/12"/>
488 <thr:in-reply-to ref="http://example.net/notice/12" href="http://example.net/notice/12"></thr:in-reply-to>
489 <link rel="ostatus:conversation" href="http://example.net/conversation/11"/>
490 <link rel="ostatus:attention" href="http://example.net/user/1"/>
491 <content type="html">@<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></content>
492 <category term="thetime"></category>
496 $_example5 = <<<EXAMPLE5
497 <?xml version="1.0" encoding="UTF-8"?>
498 <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">
500 <title>testuser timeline</title>
501 <subtitle>Updates from testuser on Zach Dev!</subtitle>
502 <logo>http://example.net/mysite/avatar/3-96-20100224004207.jpeg</logo>
503 <updated>2010-02-24T06:38:49+00:00</updated>
505 <name>testuser</name>
506 <uri>http://example.net/mysite/user/3</uri>
509 <link href="http://example.net/mysite/testuser" rel="alternate" type="text/html"/>
510 <link href="http://example.net/mysite/api/statuses/user_timeline/3.atom" rel="self" type="application/atom+xml"/>
511 <link href="http://example.net/mysite/main/sup#3" rel="http://api.friendfeed.com/2008/03#sup" type="application/json"/>
512 <link href="http://example.net/mysite/main/push/hub" rel="hub"/>
513 <link href="http://example.net/mysite/main/salmon/user/3" rel="salmon"/>
515 <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
516 <id>http://example.net/mysite/user/3</id>
517 <title>Test User</title>
518 <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
519 <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
520 <georss:point>37.7749295 -122.4194155</georss:point>
522 <poco:preferredUsername>testuser</poco:preferredUsername>
523 <poco:displayName>Test User</poco:displayName>
524 <poco:note>Just another test user.</poco:note>
526 <poco:formatted>San Francisco, CA</poco:formatted>
529 <poco:type>homepage</poco:type>
530 <poco:value>http://example.com/blog.html</poco:value>
531 <poco:primary>true</poco:primary>
536 <title>Hey man, is that Freedom Code?! #freedom #hippy</title>
537 <summary>Hey man, is that Freedom Code?! #freedom #hippy</summary>
539 <name>testuser</name>
540 <uri>http://example.net/mysite/user/3</uri>
543 <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
544 <id>http://example.net/mysite/user/3</id>
545 <title>Test User</title>
546 <link rel="alternate" type="text/html" href="http://example.net/mysite/testuser"/>
547 <link type="image/jpeg" rel="avatar" href="http://example.net/mysite/avatar/3-96-20100224004207.jpeg"/>
548 <georss:point>37.7749295 -122.4194155</georss:point>
550 <poco:preferredUsername>testuser</poco:preferredUsername>
551 <poco:displayName>Test User</poco:displayName>
552 <poco:note>Just another test user.</poco:note>
554 <poco:formatted>San Francisco, CA</poco:formatted>
557 <poco:type>homepage</poco:type>
558 <poco:value>http://example.com/blog.html</poco:value>
559 <poco:primary>true</poco:primary>
563 <link rel="alternate" type="text/html" href="http://example.net/mysite/notice/7"/>
564 <id>http://example.net/mysite/notice/7</id>
565 <published>2010-02-24T00:53:06+00:00</published>
566 <updated>2010-02-24T00:53:06+00:00</updated>
567 <link rel="ostatus:conversation" href="http://example.net/mysite/conversation/7"/>
568 <content type="html">Hey man, is that Freedom Code?! #<span class="tag"><a href="http://example.net/mysite/tag/freedom" rel="tag">freedom</a></span> #<span class="tag"><a href="http://example.net/mysite/tag/hippy" rel="tag">hippy</a></span></content>
569 <georss:point>37.8313160 -122.2852473</georss:point>
575 $_example6 = <<<EXAMPLE6
576 <?xml version="1.0" encoding="UTF-8"?>
578 xmlns:content="http://purl.org/rss/1.0/modules/content/"
579 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
580 xmlns:dc="http://purl.org/dc/elements/1.1/"
581 xmlns:atom="http://www.w3.org/2005/Atom"
582 xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
583 xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
584 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/"
588 <title>WordPress.com News</title>
589 <atom:link href="http://en.blog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
590 <link>http://en.blog.wordpress.com</link>
591 <description>The latest news on WordPress.com and the WordPress community.</description>
592 <lastBuildDate>Thu, 18 Mar 2010 23:25:35 +0000</lastBuildDate>
594 <generator>http://wordpress.com/</generator>
595 <language>en</language>
596 <sy:updatePeriod>hourly</sy:updatePeriod>
597 <sy:updateFrequency>1</sy:updateFrequency>
598 <cloud domain='en.blog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
600 <url>http://www.gravatar.com/blavatar/e6392390e3bcfadff3671c5a5653d95b?s=96&d=http://s2.wp.com/i/buttonw-com.png</url>
601 <title>WordPress.com News</title>
602 <link>http://en.blog.wordpress.com</link>
604 <atom:link rel="search" type="application/opensearchdescription+xml" href="http://en.blog.wordpress.com/osd.xml" title="WordPress.com News" />
605 <atom:link rel='hub' href='http://en.blog.wordpress.com/?pushpress=hub'/>
608 <title>Rub-a-Dub-Dub in the PubSubHubbub</title>
609 <link>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/</link>
610 <comments>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/#comments</comments>
611 <pubDate>Wed, 03 Mar 2010 16:48:12 +0000</pubDate>
612 <dc:creator>Joseph Scott</dc:creator>
614 <category><![CDATA[Feeds]]></category>
615 <category><![CDATA[atom]]></category>
616 <category><![CDATA[pubsubhubbub]]></category>
617 <category><![CDATA[rss]]></category>
619 <guid isPermaLink="false">http://en.blog.wordpress.com/?p=3857</guid>
620 <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>
621 <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>
622 <p>Today we’ve turned on PuSH support for the more than 10.5 million blogs on WordPress.com. There’s nothing to configure, it’s working right now behind the scenes to help others keep up to date with your posts.</p>
623 <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>
624 <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’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>
625 <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>
626 <wfw:commentRss>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/feed/</wfw:commentRss>
628 <slash:comments>96</slash:comments>
630 <media:content url="http://1.gravatar.com/avatar/582b66ad5ae1b69c7601a990cb9a661a?s=96&d=identicon" medium="image">
631 <media:title type="html">josephscott</media:title>
638 $_example7 = <<<EXAMPLE7
639 <?xml version="1.0" encoding="UTF-8"?>
640 <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/">
642 <title>evanpro's posterous</title>
643 <link>http://evanpro.posterous.com</link>
644 <description>Most recent posts at evanpro's posterous</description>
645 <generator>posterous.com</generator>
646 <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"/>
647 <atom:link rel="self" href="http://evanpro.posterous.com/rss.xml"/>
648 <atom:link rel="hub" href="http://posterous.superfeedr.com"/>
650 <pubDate>Sat, 20 Mar 2010 07:32:31 -0700</pubDate>
651 <title>Checking out captain bones</title>
652 <link>http://evanpro.posterous.com/checking-out-captain-bones</link>
653 <guid>http://evanpro.posterous.com/checking-out-captain-bones</guid>
660 <p><a href="http://evanpro.posterous.com/checking-out-captain-bones">Permalink</a>
662 | <a href="http://evanpro.posterous.com/checking-out-captain-bones#comment">Leave a comment »</a>
667 <posterous:userImage>http://files.posterous.com/user_profile_pics/480326/2009-08-05-142447.jpg</posterous:userImage>
668 <posterous:profileUrl>http://posterous.com/people/3sDslhaepotz</posterous:profileUrl>
669 <posterous:firstName>Evan</posterous:firstName>
670 <posterous:lastnNme>Prodromou</posterous:lastnNme>
671 <posterous:nickName>evanpro</posterous:nickName>
672 <posterous:displayName>Evan Prodromou</posterous:displayName>
679 $_example8 = <<<EXAMPLE8
680 <?xml version="1.0"?>
681 <feed xmlns="http://www.w3.org/2005/Atom">
682 <link href="http://pubsubhubbub.appspot.com/" rel="hub"/>
683 <title type="text">Activity Stream for: zcopley</title>
684 <id>http://cliqset.com/feed/atom?uid=zcopley</id>
685 <entry xmlns:service="http://activitystrea.ms/service-provider" xmlns:activity="http://activitystrea.ms/spec/1.0/">
686 <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total>
687 <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
688 <published>2010-03-22T01:35:53.000Z</published>
691 <uri>http://flickr.com</uri>
692 <icon>http://cliqset-services.s3.amazonaws.com/flickr.png</icon>
695 <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
696 <title type="text">IMG_1368</title>
697 <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/6f6fbee9d7dfbffc73b6ef626275eb5f_thumb.jpg"/>
698 <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4452933806/"/>
701 <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
702 <title type="text">IMG_1365</title>
703 <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/b8f3932cd0bba1b27f7c8b3ef986915e_thumb.jpg"/>
704 <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4442630390/"/>
706 <activity:object xmlns:media="http://purl.org/syndication/atommedia">
707 <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
708 <title type="text">Classic</title>
709 <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/fc54c15f850b7a9a8efa644087a48c91_thumb.jpg"/>
710 <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4430754103/"/>
711 <media:description type="text">-Powered by pikchur.com/n0u</media:description>
714 <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
715 <title type="text">IMG_1363</title>
716 <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/4b1d307c9217e2114391a8b229d612cb_thumb.jpg"/>
717 <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4416969717/"/>
720 <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
721 <title type="text">IMG_1361</title>
722 <link type="image/jpeg" rel="preview" href="http://media.cliqset.com/23d9b4b96b286e0347d36052f22f6e60_thumb.jpg"/>
723 <link rel="alternate" type="text/html" href="http://www.flickr.com/photos/zcopley/4417734232/"/>
725 <title type="text">zcopley posted some photos on Flickr</title>
726 <summary type="text">zcopley posted 5 photos on Flickr</summary>
727 <category scheme="http://schemas.cliqset.com/activity/categories/1.0" term="PhotoPosted" label="Photo Posted"/>
728 <updated>2010-03-22T20:46:42.778Z</updated>
729 <id>tag:cliqset.com,2010-03-22:/user/zcopley/SVgAZubGhtAnSAee</id>
730 <link href="http://cliqset.com/user/zcopley/SVgAZubGhtAnSAee" type="text/xhtml" rel="alternate" title="zcopley posted some photos on Flickr"/>
733 <uri>http://cliqset.com/user/zcopley</uri>
735 <activity:actor xmlns:poco="http://portablecontacts.net/spec/1.0">
736 <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
739 <poco:givenName>Zach</poco:givenName>
740 <poco:familyName>Copley</poco:familyName>
742 <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"/>
743 <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"/>
744 <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"/>
750 $_example9 = <<<EXAMPLE9
751 <?xml version="1.0" encoding="utf-8"?>
752 <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/">
753 <link rel="self" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/117848251937215158042/public/posted"/>
754 <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
755 <title type="text">Google Buzz</title>
756 <updated>2010-03-22T01:55:53.596Z</updated>
757 <id>tag:google.com,2009:buzz-feed/public/posted/117848251937215158042</id>
758 <generator>Google - Google Buzz</generator>
760 <title type="html">Buzz by Zach Copley from Flickr</title>
761 <summary type="text">IMG_1366</summary>
762 <published>2010-03-18T04:29:23.000Z</published>
763 <updated>2010-03-18T05:14:03.325Z</updated>
764 <id>tag:google.com,2009:buzz/z12zwdhxowq2d13q204cjr04kzu0cns5gh0</id>
765 <link rel="alternate" type="text/html" href="http://www.google.com/buzz/117848251937215158042/ZU7b6mHJEmC/IMG-1366"/>
767 <name>Zach Copley</name>
768 <uri>http://www.google.com/profiles/zcopley</uri>
770 <content type="html"><div>IMG_1366</div></content>
771 <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" title="IMG_1366"/>
772 <media:content url="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" medium="image">
773 <media:title>IMG_1366</media:title>
774 <media:player url="http://farm5.static.flickr.com/4053/4442630700_980b19a1a6_o.jpg" height="1600" width="1200"/>
776 <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" title="IMG_1365"/>
777 <media:content url="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" medium="image">
778 <media:title>IMG_1365</media:title>
779 <media:player url="http://farm5.static.flickr.com/4043/4442630390_62da5560ae_o.jpg" height="1200" width="1600"/>
781 <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
783 <activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
784 <id>tag:google.com,2009:buzz/z12zwdhxowq2d13q204cjr04kzu0cns5gh0</id>
785 <title>Buzz by Zach Copley from Flickr</title>
786 <content type="html"><div>IMG_1366</div></content>
787 <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630700" type="image/jpeg" title="IMG_1366"/>
788 <link rel="enclosure" href="http://www.flickr.com/photos/22823034@N00/4442630390" type="image/jpeg" title="IMG_1365"/>
790 <link rel="replies" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/117848251937215158042/comments/z12zwdhxowq2d13q204cjr04kzu0cns5gh0" thr:count="0"/>
791 <thr:total>0</thr:total>