init
This commit is contained in:
4
livejournal/htdocs/misc/ack-devserver.bml
Executable file
4
livejournal/htdocs/misc/ack-devserver.bml
Executable file
@@ -0,0 +1,4 @@
|
||||
<?_code
|
||||
return BML::redirect($LJ::SITEROOT) unless $LJ::ANTI_SQUATTER;
|
||||
return BML::redirect($POST{'dest'} || $LJ::SITEROOT);
|
||||
_code?>
|
||||
40
livejournal/htdocs/misc/interestdata.bml
Executable file
40
livejournal/htdocs/misc/interestdata.bml
Executable file
@@ -0,0 +1,40 @@
|
||||
<?_code
|
||||
{
|
||||
use strict;
|
||||
use vars qw(%GET);
|
||||
|
||||
BML::set_content_type("text/plain; charset=utf-8");
|
||||
if ($GET{'user'}) {
|
||||
my $user = LJ::canonical_username($GET{'user'});
|
||||
return "! bogus username\n" unless $user;
|
||||
my $u = LJ::load_user($user);
|
||||
return "! invalid user, or no interests\n" unless $u;
|
||||
|
||||
my $ret;
|
||||
|
||||
my $ints = LJ::get_interests($u) || [];
|
||||
foreach my $int (@$ints) {
|
||||
$ret .= "$int->[0] $int->[2] $int->[1]\n";
|
||||
}
|
||||
|
||||
return "! invalid user, or no interests\n" unless $ret;
|
||||
$ret = "# Note: Polite data miners cache on their end. Impolite ones get banned.\n" .
|
||||
"# <intid> <intcount> <interest ...>\n" .
|
||||
$ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if ($GET{'int'}) {
|
||||
my $dbr = LJ::get_db_reader();
|
||||
my $sth = $dbr->prepare("SELECT * FROM interests WHERE interest=?");
|
||||
$sth->execute($GET{'int'});
|
||||
my $h = $sth->fetchrow_hashref;
|
||||
return "! invalid interest\n" unless $h;
|
||||
my $ret;
|
||||
$ret = "# Note: Polite data miners cache on their end. Impolite ones get banned.\n" .
|
||||
"= intcount=$h->{intcount}\n";
|
||||
return $ret;
|
||||
}
|
||||
return "! invalid parameters\n";
|
||||
}
|
||||
_code?>
|
||||
36
livejournal/htdocs/misc/weblogs-change.bml
Executable file
36
livejournal/htdocs/misc/weblogs-change.bml
Executable file
@@ -0,0 +1,36 @@
|
||||
<?_code
|
||||
{
|
||||
use strict;
|
||||
use vars qw(%FORM);
|
||||
|
||||
return "no user" unless $FORM{'user'};
|
||||
|
||||
my $dbr = LJ::get_db_reader();
|
||||
my $u = LJ::load_user($FORM{'user'});
|
||||
return "no user" unless $u;
|
||||
|
||||
my $tu = $dbr->selectrow_array("SELECT timeupdate FROM userusage WHERE userid=?",
|
||||
undef, $u->{'userid'});
|
||||
|
||||
# we have no _fucking_ clue how weblogs.com detects changes. god forbid
|
||||
# it should be documented.
|
||||
|
||||
# here are some guesses, based on other people's half-educated guesses
|
||||
# in mailing lists:
|
||||
|
||||
# attempt #1: (change HTTP last modified)
|
||||
my $modtime = LJ::mysqldate_to_time($tu);
|
||||
BML::want_last_modified(1);
|
||||
BML::note_mod_time($modtime);
|
||||
|
||||
# attempt #2: (change the page text)
|
||||
my $ret = "New post (not edit) at: $tu\n";
|
||||
|
||||
# attempt #3: (make the returned content differ by 50 bytes (!?!))
|
||||
# waste 50b - 2.5k on bogus ex characters, modulus some seconds
|
||||
$ret .= "Bogus chars to unconfuse weblogs.com:\n";
|
||||
$ret .= "x" x ($modtime % 50 * 50);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
_code?>
|
||||
Reference in New Issue
Block a user