[livejournal] r17897: LJSUP-7240: Endpoint get_day_counts rena...
Committer: dnikolaev
LJSUP-7240: Endpoint get_day_counts renamed to get_posting_daysD trunk/htdocs/tools/endpoints/get_day_counts.bml A trunk/htdocs/tools/endpoints/get_posting_days.bml
Deleted: trunk/htdocs/tools/endpoints/get_day_counts.bml
===================================================================
--- trunk/htdocs/tools/endpoints/get_day_counts.bml 2010-12-10 06:00:03 UTC (rev 17896)
+++ trunk/htdocs/tools/endpoints/get_day_counts.bml 2010-12-10 07:32:48 UTC (rev 17897)
@@ -1,35 +0,0 @@
-<?_code
-{
- use strict;
- use LJ::Talk;
-
- sub error
- {
- return LJ::JSON->to_json({ error => $_[0] });
- }
-
- use vars qw(%GET %ML);
-
- return error('Server is down') if $LJ::SERVER_DOWN;
-
- $GET{journal} =~ s/^3D//;
- $GET{journal} ||= '';
- my $u = LJ::load_user($GET{journal}) or return error("Invalid journal: '$GET{journal}'");
-
- my $counts = {};
- my $remote = LJ::get_remote();
- my $days = LJ::get_daycounts($u, $remote);
- foreach my $day (@$days) {
- # $day->[3] - count
- push @{$counts->{$day->[0]}->{$day->[1]}}, $day->[2];
- }
-
- BML::set_content_type('text/javascript; charset=utf-8');
- BML::finish();
- BML::noparse();
-
- return LJ::JSON->to_json($counts);
-}
-
-_code?>
-
Copied: trunk/htdocs/tools/endpoints/get_posting_days.bml (from rev 17896, trunk/htdocs/tools/endpoints/get_day_counts.bml)
===================================================================
--- trunk/htdocs/tools/endpoints/get_posting_days.bml (rev 0)
+++ trunk/htdocs/tools/endpoints/get_posting_days.bml 2010-12-10 07:32:48 UTC (rev 17897)
@@ -0,0 +1,35 @@
+<?_code
+{
+ use strict;
+ use LJ::Talk;
+
+ sub error
+ {
+ return LJ::JSON->to_json({ error => $_[0] });
+ }
+
+ use vars qw(%GET %ML);
+
+ return error('Server is down') if $LJ::SERVER_DOWN;
+
+ $GET{journal} =~ s/^3D//;
+ $GET{journal} ||= '';
+ my $u = LJ::load_user($GET{journal}) or return error("Invalid journal: '$GET{journal}'");
+
+ my $counts = {};
+ my $remote = LJ::get_remote();
+ my $days = LJ::get_daycounts($u, $remote);
+ foreach my $day (@$days) {
+ # $day->[3] - count
+ push @{$counts->{$day->[0]}->{$day->[1]}}, $day->[2];
+ }
+
+ BML::set_content_type('text/javascript; charset=utf-8');
+ BML::finish();
+ BML::noparse();
+
+ return LJ::JSON->to_json($counts);
+}
+
+_code?>
+
