alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[livejournal] r17826: OPSC-196: Implement universal LJ widget ...

Committer: afedorov
OPSC-196: Implement universal LJ widget to show activities: 'Friends Activity' and 'Recent Activity'

U   trunk/htdocs/userinfo.bml
Modified: trunk/htdocs/userinfo.bml
===================================================================
--- trunk/htdocs/userinfo.bml	2010-11-30 07:35:02 UTC (rev 17825)
+++ trunk/htdocs/userinfo.bml	2010-11-30 08:41:57 UTC (rev 17826)
@@ -1547,23 +1547,22 @@
             push @userapps, $app_string;
         }
 
+        use LJ::UserApps::Activities;
         my @activities;
         if (scalar @userapps) {
-            my $result = LJ::API::Activity->get_last( user => $u );
-            if ($result->{status} eq 'OK') {
-                foreach (@{$result->{activities}}) {
-                    my $app = LJ::UserApps->get_application( id => $_->{application_id} );
-                    LJ::CleanHTML::clean_subject(\$_->{title});
-                    LJ::CleanHTML::clean_event(\$_->{body}, {});
-                    push @activities, {
-                        app_name  => $app->name,
-                        app_href  => $app->href,
-                        app_image => $app->image,
-                        title     => $_->{title},
-                        body      => $_->{body},
-                        date      => LJ::TimeUtil->ago_text(time() - $_->{ts_create}),
-                    };
-                }
+            my $result = LJ::UserApps::Activities->get_last( $u );
+            foreach (@$result) {
+                my $app = LJ::UserApps->get_application( id => $_->{application_id} );
+                LJ::CleanHTML::clean_subject(\$_->{title});
+                LJ::CleanHTML::clean_event(\$_->{body}, {});
+                push @activities, {
+                    app_name  => $app->name,
+                    app_href  => $app->href,
+                    app_image => $app->image,
+                    title     => $_->{title},
+                    body      => $_->{body},
+                    date      => LJ::TimeUtil->ago_text(time() - $_->{ts_create}),
+                };
             }
         }
 

Tags: bml, livejournal, red_alf
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