250) $n = 250; if (intval($n) == 0) $n = 100; if ($_SERVER['REQUEST_METHOD'] == "POST") { header("HTTP/1.1 403 Not Allowed"); die(); } header("Content-Type: text/html"); header("Cache-Control: private, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("$expire"); header("$lastmod"); if (!$_SERVER['HTTP_X_FORWARDED_FOR']) header("X-Remote-IP:" . $_SERVER['REMOTE_ADDR']); if ($_SERVER['HTTP_X_FORWARDED_FOR']) header("X-Remote-IP:" . $_SERVER['HTTP_X_FORWARDED_FOR']); if ($refresh != '') { header("Refresh: $refresh"); } if ($_SERVER['REQUEST_METHOD'] == "HEAD") { header("X-Request: HEAD"); die(); } $html =' '; if ($refresh != '') { $html .= ""; } if(!$_GET['error']) $html .= " The $n most recent LiveJournal Images: \r\n"; if($_GET['error']) $html .= " Page not found \r\n"; $html .= file_get_contents("header-lj.txt"); $agentstring = $_SERVER['HTTP_USER_AGENT']; if (!(strrpos($agentstring, "MSIE"))) { // note: three equal signs $html .= file_get_contents("sidebar.txt"); } else { $html .= file_get_contents("sidebar-ff.txt"); } if(!$_GET['error']) { if ($refresh > 0) $refr_str = "This page will refresh in $refresh seconds"; $html .= "
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 .= "
\n" . "Display:" . "\n" . "Refresh:"; if (!$refresh) { $html .= "\n"; $html .= " \n"; } $html .= ' '; $html .= "\n" . // " '};if(t!=''){document.write('ImageShack

ImageShack has found the following images on this page.

Click on any image to host it on ImageShack, or press the back button to return to the previous page.

'+t+'
');void(document.close())}else{alert('There are no images to host on this page.')}\">ImageShack Transloader" . ""; } 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" . " ".$image."\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" . "" . "\"IPv6" . "\"Valid
"; // $html .= ""; session_write_close(); echo $html; if ($cached == false) { srand((double)microtime()*20); #$num = rand(0,10); #if (($num % $onum) == 0) } else { } ?>