ActivityParseTests.php 54 KB

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