vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[ljcom] r9996: =LJSUP-7770: Add some events to event st...

Committer: vsukhanov
=LJSUP-7770: Add some events to event stream
A   trunk/cgi-bin/LJ/EventsFeed/CommentsChanged.pm
A   trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm
A   trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm
Added: trunk/cgi-bin/LJ/EventsFeed/CommentsChanged.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/CommentsChanged.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/EventsFeed/CommentsChanged.pm	2011-02-07 08:13:25 UTC (rev 9996)
@@ -0,0 +1,27 @@
+package LJ::EventsFeed::CommentsChanged;
+
+use strict;
+use base 'LJ::EventsFeed';
+use Carp qw (croak);
+
+sub new {
+    my ($class, $u, $entry) = @_;
+
+    return $class->SUPER::new(
+                              userid      => $u->userid,
+                              userlogin   => $u->user,
+                              entry_url   => $entry->url,
+                             );
+}
+
+sub as_xml {
+    my $self = shift;
+    my $params = $self->params;
+
+    return $self->xml_head('comments_changed') 
+            . "<journal name='$params->{userlogin}' id='$params->{userid}' />"
+            . "<entry url='$params->{entry_url}' />"
+            . $self->xml_footer;
+}
+
+1;

Added: trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/EventsFeed/EntryUpdated.pm	2011-02-07 08:13:25 UTC (rev 9996)
@@ -0,0 +1,27 @@
+package LJ::EventsFeed::EntryUpdated;
+
+use strict;
+use base 'LJ::EventsFeed';
+use Carp qw (croak);
+
+sub new {
+    my ($class, $u, $entry) = @_;
+
+    return $class->SUPER::new(
+                              userid      => $u->userid,
+                              userlogin   => $u->user,
+                              entry_url   => $entry->url,
+                             );
+}
+
+sub as_xml {
+    my $self = shift;
+    my $params = $self->params;
+
+    return $self->xml_head('entry_updated') 
+            . "<journal name='$params->{userlogin}' id='$params->{userid}' />"
+            . "<entry url='$params->{entry_url}' />"
+            . $self->xml_footer;
+}
+
+1;

Added: trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/EventsFeed/NewEntry.pm	2011-02-07 08:13:25 UTC (rev 9996)
@@ -0,0 +1,27 @@
+package LJ::EventsFeed::NewEntry;
+
+use strict;
+use base 'LJ::EventsFeed';
+use Carp qw (croak);
+
+sub new {
+    my ($class, $u, $entry) = @_;
+
+    return $class->SUPER::new(
+                              userid      => $u->userid,
+                              userlogin   => $u->user,
+                              entry_url   => $entry->url,
+                             );
+}
+
+sub as_xml {
+    my $self = shift;
+    my $params = $self->params;
+
+    return $self->xml_head('new_entry') 
+            . "<journal name='$params->{userlogin}' id='$params->{userid}' />"
+            . "<entry url='$params->{entry_url}' />"
+            . $self->xml_footer;
+}
+
+1;

Tags: ljcom, pm, vadvs
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments