ActivityParseTests.php 53 KB

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