From: Evan Prodromou Date: Sun, 14 Feb 2010 17:08:09 +0000 (-0500) Subject: More complete activity parsing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;ds=sidebyside;h=62f5c04ad234be6d1a26097300944eacee895738;p=quix0rs-gnu-social.git More complete activity parsing Began the process of actually digging up activity information from an Atom entry. Added a test script to make sure parsing is working right. --- diff --git a/plugins/OStatus/tests/ActivityParseTests.php b/plugins/OStatus/tests/ActivityParseTests.php new file mode 100644 index 0000000000..889fa892f0 --- /dev/null +++ b/plugins/OStatus/tests/ActivityParseTests.php @@ -0,0 +1,80 @@ +documentElement); + + $this->assertFalse(empty($act)); + $this->assertEquals($act->time, 1243860840); + $this->assertEquals($act->verb, ActivityVerb::POST); + } +} + +$_example1 = << + + tag:versioncentral.example.org,2009:/commit/1643245 + 2009-06-01T12:54:00Z + Geraldine committed a change to yate + Geraldine just committed a change to yate on VersionCentral + + http://activitystrea.ms/schema/1.0/post + http://versioncentral.example.org/activity/commit + + http://versioncentral.example.org/activity/changeset + tag:versioncentral.example.org,2009:/change/1643245 + Punctuation Changeset + Fixing punctuation because it makes it more readable. + + + +EXAMPLE1; + +$_example2 = << + + tag:photopanic.example.com,2008:activity01 + Geraldine posted a Photo on PhotoPanic + 2008-11-02T15:29:00Z + + + http://activitystrea.ms/schema/1.0/post + + + tag:photopanic.example.com,2008:photo01 + My Cat + 2008-11-02T15:29:00Z + + + tag:atomactivity.example.com,2008:photo + + + Geraldine's Photos + + + + + + <p>Geraldine posted a Photo on PhotoPanic</p> + <img src="/geraldine/photo1.jpg"> + + +EXAMPLE2;