This script displays the $n most recent images on livejournal.
You can use the controls below to change the number of images displayed and the rate the page refreshes. (The maximum number of images is 250)
To opt-out, go to the command console and type \"set latest_optout yes\" (without the quotes) and hit execute.
Web 2.0 version!
Twitter version!
$refr_str
Warning: Some of these pictures might not be work safe.
";
$html .= "
";
} else {
$html .= "
Sorry, I couldn't find the page you were looking for, here are some random images
for your trouble.
";
$html .= "
This tool takes images from the most recent entries at LiveJournal.com... They may be subject to copyright and may not be work safe.
";
}
$html .= "
";
$html .= file_get_contents("ads.php");
unset($fp);
$old = filemtime('/mnt/ram/lj.tmp');
$old = date('U') - $old;
$num = rand(0,10);
$size = filesize('/tmp/lj.tmp');
if ((($num >= $ci) || ($old > $maxcacheage) || (!$_GET['error']) || $_GET['nocache']) || ($size < 1000))
$fp = fsockopen('www.livejournal.com.', 80);
$ch = curl_init("http://www.livejournal.com/stats/latest-img.bml");
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_USERAGENT, $s . "; " . $e);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
if(stripos($referrer, 'bot') !== FALSE && file_exists('/tmp/ljimages.xml')) {
$data = file_get_contents('/tmp/ljimages.xml');
} else {
$data = curl_exec($ch);
file_put_contents('/Volumes/Orca/ljimages/' . time() . '.xml', $data);
file_put_contents('/tmp/ljimages.xml', $data);
}
preg_match_all("", $data, $out);
$now = date("U");
for ($i=0; $i<$n; $i++) {
$journal = $out[2][$i];
$image = $out[1][$i];
if ($_COOKIE['goon'] == 'y')
$journal = $image;
$html .= "
\r\n";
if (($i >= ($n/2)) && ($ads != true)) {
// $html .= "
" . file_get_contents("ads.php") . "
";
$ads = true;
}
$html .= "
\r\n" .
"
\r\n" .
"

\r\n" .
# "

\r\n" .
" \r\n";
if ($i >= 250)
break;
}
$html .= "
\r\n";
$html .= "
\r\n";
$html .= file_get_contents("ads.php");
$html .= "
Top Refresh" .
"
\r\n" .
"\r\n";
if(!$_SERVER['HTTP_X_FORWARDED_FOR'])
$ipaddr = $_SERVER["REMOTE_ADDR"];
if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ipaddr = $_SERVER['HTTP_X_FORWARDED_FOR'];
$html .= "
#";
$html .= $counted;
if ($cached) {
$hit = "cache hit";
} else {
$hit = "cache miss";
}
$duration = 0.1;
$html .= " generated for " . $ipaddr .
" on " . date("D F j H:i:s T Y") . "
\r\n\r\n" .
"My code" .
"
Copyright 2004, Nicholas Suan. Except what's not
" .
"page generated in: ". $duration ." seconds. " .
"images: $n $hit
\n" .
"
\r\n" .
"" .
"
" .
"
";
// $html .= "";
session_write_close();
echo $html;
if ($cached == false) {
srand((double)microtime()*20);
#$num = rand(0,10);
#if (($num % $onum) == 0)
} else {
}
?>