Registration has been disabled and the moderation extension has been turned off.
Contact an admin on Discord or EDF if you want an account. Also fuck bots.

User:CrackRabbit/livejournals/php: Difference between revisions

From Encyclopedia Dramatica
Jump to navigation Jump to search
imported>Weasel
Created page with "<pre> <?php $contents = strtolower (file_get_contents ("data.txt")); $report = array (); foreach (explode ("\n", $contents) as $line) { $line = trim ($line); $url = array (); ..."
 
imported>Weasel
Created page with "<pre> <?php $contents = strtolower (file_get_contents ("data.txt")); $report = array (); foreach (explode ("\n", $contents) as $line) { $line = trim ($line); $url = array (); ..."
(No difference)

Revision as of 07:58, 7 May 2013

<?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";
}
?>