Make the RSS driver actually generate the activity: elements when you call as_xml.
Mark Atkins [Wed, 7 Jan 2009 22:50:02 +0000 (22:50 +0000)]
lib/XML/Feed/Format/RSS.pm

index 0da42b0..03b064f 100644 (file)
@@ -26,6 +26,7 @@ sub init_empty {
     $feed->{rss}->add_module(prefix => "dcterms", uri => 'http://purl.org/dc/terms/');    
     $feed->{rss}->add_module(prefix => "atom", uri => 'http://www.w3.org/2005/Atom');
     $feed->{rss}->add_module(prefix => "geo", uri => 'http://www.w3.org/2003/01/geo/wgs84_pos#');
+    $feed->{rss}->add_module(prefix => "activity", uri => 'http://activitystrea.ms/spec/1.0/');
     $feed;
 }
 
@@ -330,22 +331,24 @@ sub long {
 }
 
 sub activity_verbs {
+    # FIXME: Make this support multiple verbs
     my $item = shift->{entry};
     if (@_) {
-        $item->{"http://activitystrea.ms/spec/1.0/"}{verb} = \@_;
+        $item->{activity}{verb} = $_[0];
     } else {
-        my $verbs = $item->{"http://activitystrea.ms/spec/1.0/"}{verb};
+        my $verbs = $item->{activity}{verb};
 
         return defined($verbs) ? (ref $verbs ? @$verbs : ($verbs)) : ();
     }
 }
 
 sub activity_object_types {
+    # FIXME: Make this support multiple types
     my $item = shift->{entry};
     if (@_) {
-        $item->{"http://activitystrea.ms/spec/1.0/"}{'object-type'} = \@_;
+        $item->{activity}{'object-type'} = $_[0];
     } else {
-        my $types = $item->{"http://activitystrea.ms/spec/1.0/"}{'object-type'};
+        my $types = $item->{activity}{'object-type'};
 
         return defined($types) ? (ref $types ? @$types : ($types)) : ();
     }