ActivityParseTests.php 54 KB

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