- Portals
- The Current Year
- ED in the News
- Admins
- Help ED Rebuild
- Archive
- ED Bookmarklet
- Donate Bitcoin
Contact an admin on Discord or EDF if you want an account. Also fuck bots.
User:CrackRabbit/livejournals/php
From Encyclopedia Dramatica
Jump to navigationJump to search
<?php
$contents = strtolower (file_get_contents ("data.txt"));
$report = array ();
foreach (explode ("\n", $contents) as $line) {
$line = trim ($line);
$url = array ();
$url[0] = strpos ($line, "http://");
$url[1] = strpos ($line, " ");
if ($url[0] === false) {
continue;
}
$url = substr ($line, $url[0], $url[1] - $url[0]);
if (strpos ($url, "~")) {
$url = explode ("~", $url);
$url = "http://{$url[1]}.livejournal.com";
} else if (strpos ($url, "http://community") !== false || strpos ($url, "http://pics") !== false || strpos ($url, "http://ic.pics") !== false) {
$url = explode ("/", $url);
$url = "http://{$url[3]}.livejournal.com";
} else if (strpos ($url, "users/")) {
$url = explode ("/", $url);
$url = "http://{$url[4]}.livejournal.com";
} else if (strpos ($url, "http://news.") !== false) {
continue;
} else {
$url = explode ("//", $url);
$url = explode (".", $url);
$url = "http://{$url[0]}.livejournal.com";
}
if (!in_array ($url, $report)) {
$report[] = $url;
}
}
asort ($report);
printf ("Listed below are %s LiveJournal accounts.\n----\n", count ($report));
foreach ($report as $key => $url) {
print "*$url\n";
}
?>