Name: NiggerSlut 2007-09-23 23:09 ID:wzDxoX0m
<?php
//Board address
$address = 'http://img.4chan.org/b';;
//RegExp Patterns
$PicPattern = '/\/src\/.+?.\.(jpg|png|gif|swf)/';
$ReplyPattern = '/res\/.+?.html/';
//Parse Threads from Boards first page
$page = file_get_contents("$address/imgboard.html");
preg_match_all($ReplyPattern, $page, $threads);
//Get picture URL:s from the first Thread
$page = file_get_contents("$address/" .$threads[0][0]);
preg_match_all($PicPattern, $page, $pics);
$lastpic = end($pics['0']);
//Echo result
echo "<img src='$address$lastpic' height='50%'>";
die();
?>
//Board address
$address = 'http://img.4chan.org/b';;
//RegExp Patterns
$PicPattern = '/\/src\/.+?.\.(jpg|png|gif|swf)/';
$ReplyPattern = '/res\/.+?.html/';
//Parse Threads from Boards first page
$page = file_get_contents("$address/imgboard.html");
preg_match_all($ReplyPattern, $page, $threads);
//Get picture URL:s from the first Thread
$page = file_get_contents("$address/" .$threads[0][0]);
preg_match_all($PicPattern, $page, $pics);
$lastpic = end($pics['0']);
//Echo result
echo "<img src='$address$lastpic' height='50%'>";
die();
?>