bryant: (Default)
[personal profile] bryant
The LJ Secret Crush meme is fairly vile, since they collected a bunch of information and are now selling it and maybe you didn't want to let that person know you had a crush on them? Too late now.

[livejournal.com profile] rowyn passed on a great idea from [livejournal.com profile] peganthyrus. She suggested that we pick random users and fill out crush info for them, poisoning the database. That's not bad.

This works on my system. Maybe it'll work on yours. At the moment it spews the HTML for the return page to standard output, because I couldn't be bothered to parse through it and summarize results. There is no error-checking. The code is low-quality. You will need the CPAN modules HTML::TokeParser and WWW::Mechanize.

#!/usr/bin/perl

use HTML::TokeParser;
use LWP::UserAgent;
use WWW::Mechanize;

$ua = LWP::UserAgent->new;
$ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)");
$ua->requests_redirectable([ ]);

$random = HTTP::Request->new(HEAD => 'http://www.livejournal.com/random.bml');
my $res = $ua->request($random);

($user = $res->headers->header('Location')) =~ s#^.*/(.*)/#$1#;

if (! $user) {
        die "Couldn't get random LJ user.\n";
}

print STDERR "Crushing ", $user, "\n";

my $agent = WWW::Mechanize->new();

$agent->get("http://euthanize.us/memes/secret-crush-meme/");
$agent->form(1);
$agent->field("username", $user);
$agent->click;

@types = ("Never Crushed", "Secret Crush", "Public Crush", "Ex-Crush");

$agent->form(1);
$crushform = $agent->current_form;
@friends = split(/,/, $crushform->value("friends"));
for ($i = 0; $i <= $#friends; $i++) {
        $crushtype = $types[int(rand(4))];
        $friendfield = "friend" . $i;
        $agent->field($friendfield, $crushtype);
}

$gender = (rand(2) > 1 ? "Male" : "Female");
$agent->field("gender", $gender);
$agent->click;

print $agent->content;

Date: 2004-02-07 01:32 am (UTC)
ext_646: (HAPPY!)
From: [identity profile] shatterstripes.livejournal.com
You are a bad person, and I love you for it!

Re:

Date: 2004-02-07 02:37 am (UTC)
ext_646: (HAPPY!)
From: [identity profile] shatterstripes.livejournal.com
I was hoping someone would decide to code up a script. Now to find out if it'll work with the default OSX installation of Perl... awww, it doesn't. (And I'm leery of trying to install 'em; last time I tried that the 'helpful' Perl package manager decided to update me to the absolute latest version of Perl without asking, and it still didn't install the bits I wanted.)

Re:

Date: 2004-02-08 04:30 pm (UTC)
From: [identity profile] tayefeth.livejournal.com
Is this (http://www.euthanize.us/memes/crushmeme/) the same thing?

Re:

Date: 2004-02-08 07:01 pm (UTC)
ext_646: (HAPPY!)
From: [identity profile] shatterstripes.livejournal.com
*applause*

Well done!

Re:

Date: 2004-07-24 10:47 pm (UTC)
From: [identity profile] reachforlight.livejournal.com
you are icky.
(deleted comment)

Re: Fixing the output

Date: 2004-02-12 09:21 am (UTC)
dtm: (Default)
From: [personal profile] dtm
It's not so much the angle brackets as the close-tr tag that showed up in the perl code to de-htmlize the output.

This is probably a bug that should be reported - livejournal does some checking so that early close tags in entries can't completely mess up a friends view (to completely mess up a friends view, I think you'd need a close-div, close-table, close-div combination, and they seem to strip close tags after an extraneous close-div) An extraneous close-div or close-tr in an entry still produces interesting effects, but they don't bleed onto the rest of the page.

It would seem that they could do similar checking in the comments to prevent the extraneous close-tr from wreaking havoc.

Date: 2004-02-07 10:48 pm (UTC)
From: [identity profile] my-tallest.livejournal.com
Always good to see more perl, but I have to say, it's a dangerous idea. Now I could get into this database, despite having avoided the meme (and not being crush-worthy).

Date: 2004-02-10 03:16 pm (UTC)
From: [identity profile] evilhat.livejournal.com
Of course, now they have Secret Crush Meme 3.

Date: 2004-02-18 03:38 pm (UTC)
From: [identity profile] sathethert.livejournal.com
Just one question...why?

I can't say I've used the secret crush meme simply because....well.....I don't give a shit. I mean honestly, who really cares who has a crush on you? But as far as crashing it, what's the point?

Re:

Date: 2004-02-18 07:07 pm (UTC)
From: [identity profile] sathethert.livejournal.com
Everyone has to assume that filling out a meme or online quiz will submit their personal info. And I could be thinking of another meme, but I believe when I clicked on it to see what it was a few weeks ago, it SAID that they would use my personal information.

Re:

Date: 2004-02-19 12:51 pm (UTC)
From: [identity profile] quasidan.livejournal.com
Aren't you being a little harsh?

confused

Date: 2004-02-19 07:18 pm (UTC)
From: [identity profile] nekoexcel.livejournal.com
How in the world would they find out who has a crush on who? I'm so very confused.

Re: confused

Date: 2004-04-09 11:34 am (UTC)
From: [identity profile] deutch-guy.livejournal.com
You're my kind of dumb broad!

Re: confused

Date: 2004-04-09 12:53 pm (UTC)
From: [identity profile] nekoexcel.livejournal.com
and you're my kind of asshole

So, apparently, you win.

Date: 2004-12-25 03:10 am (UTC)
From: [identity profile] jadasc.livejournal.com
http://www.euthanize.us/memes/secret-crush-meme/

You are given the credit for having slain the Crush Meme. Please report to your DM to get your XP.

October 2025

S M T W T F S
    1234
567891011
12131415161718
19202122232425
2627 28293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 6th, 2026 11:24 am
Powered by Dreamwidth Studios