rideside.net

home | archive | comics | about

i ride sideways
Posted by tgl on 2005-02-22 20:04:01 +0000

pitchforkmedia today

<?php

$url = 'http://www.pitchforkmedia.com/';
$response = file_get_contents($url);
$r = preg_split('/\n/', $response);

$output = 'ripped from: <a href="'.$url.'">pitchforkmedia</a><br>';

$fpat0 = '/<!-- START FEATURED REVIEWS SECTION -->/';
$fpat1 = '/<!-- START RECENT REVIEWS SECTION -->/';

$rpat = '/record-reviews/';

for ($ii = 0; $ii < count($r); $ii++) {
if (preg_match($fpat0, $r$ii], $match)) {
for ($jj = $ii; $jj < count($r); $jj++) {

if (preg_match($rpat, $r$jj], $match)) {
$output .= $r$jj] . '<br>';
}

if (preg_match($fpat1, $r$jj], $match)) {
$ii = $jj;
break;
}
}
}
}

print $output;

?>


Find me on github.