From 05e3768e6a833d99a5180d4306d68f59e2d8f8c9 Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Fri, 19 Mar 2010 09:48:39 -0500
Subject: Parse RSS items as activities
First steps to parsing RSS items as activities. RSS feeds don't seem
to have enough data to make good remote profiles, but this may work
with some "hints".
---
tests/ActivityParseTests.php | 95 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 94 insertions(+), 1 deletion(-)
(limited to 'tests')
diff --git a/tests/ActivityParseTests.php b/tests/ActivityParseTests.php
index 7bf9cec7c..b6980a6bb 100644
--- a/tests/ActivityParseTests.php
+++ b/tests/ActivityParseTests.php
@@ -138,9 +138,38 @@ class ActivityParseTests extends PHPUnit_Framework_TestCase
$this->assertEquals($poco->urls[0]->value, 'http://example.com/blog.html');
$this->assertEquals($poco->urls[0]->primary, 'true');
$this->assertEquals($act->actor->geopoint, '37.7749295 -122.4194155');
-
}
+ public function testExample6()
+ {
+ global $_example6;
+
+ $dom = DOMDocument::loadXML($_example6);
+
+ $rss = $dom->documentElement;
+
+ $channels = $dom->getElementsByTagName('channel');
+
+ $channel = $channels->item(0);
+
+ $items = $channel->getElementsByTagName('item');
+
+ $item = $items->item(0);
+
+ $act = new Activity($item, $channel);
+
+ $this->assertEquals($act->verb, ActivityVerb::POST);
+
+ $this->assertEquals($act->id, 'http://en.blog.wordpress.com/?p=3857');
+ $this->assertEquals($act->link, 'http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/');
+ $this->assertEquals($act->title, 'Rub-a-Dub-Dub in the PubSubHubbub');
+ $this->assertEquals($act->time, 1267634892);
+
+ $actor = $act->actor;
+
+ $this->assertFalse(empty($actor));
+ $this->assertEquals($actor->title, "Joseph Scott");
+ }
}
$_example1 = <<
EXAMPLE5;
+
+$_example6 = <<
+
+
+
+ WordPress.com News
+
+ http://en.blog.wordpress.com
+ The latest news on WordPress.com and the WordPress community.
+ Thu, 18 Mar 2010 23:25:35 +0000
+
+ http://wordpress.com/
+ en
+ hourly
+ 1
+
+
+ http://www.gravatar.com/blavatar/e6392390e3bcfadff3671c5a5653d95b?s=96&d=http://s2.wp.com/i/buttonw-com.png
+ WordPress.com News
+ http://en.blog.wordpress.com
+
+
+
+
+
+ Rub-a-Dub-Dub in the PubSubHubbub
+ http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/
+ http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/#comments
+ Wed, 03 Mar 2010 16:48:12 +0000
+ Joseph Scott
+
+
+
+
+
+
+ http://en.blog.wordpress.com/?p=3857
+ ]]>
+ From the tongue twisting name department we welcome PubSubHubbub, or as some people have shortened it to: PuSH. Like rssCloud, PuSH is a way for services that subscribe to updates from your blog (think Google Reader, Bloglines or Netvibes) to get updates even faster. In a nutshell, instead of having to periodically ask 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.
+
Today we’ve turned on PuSH support for the more than 10.5 million blogs on WordPress.com. There’s nothing to configure, it’s working right now behind the scenes to help others keep up to date with your posts.
+
For those using the WordPress.org software we are releasing a new PuSH plugin: PuSHPress. This plugin differs from the current PuSH related plugins by including a built-in hub.