$e = $e > strlen($src) ? strlen($src) : $e;
        if ($e > $b) {
            return trim(substr($src, $b, $e - $b));
        }
    }
}
$URL = 'http://www.iowa-city.org/icgov/apps/police/neighborhood.asp';
$x = scraperWiki::scrape($URL);
if (!empty($x)) {
    $x = partof($x, '<h1>Neighborhood Watch Log</h1>', '<div class="clear"></div>');
    $x = partof($x, '<tbody', '</tbody>', true);
    $x = explode('</tr>', $x);
    if (count($x) > 0) {
        foreach ($x as $y) {
            if (preg_match_all('/<td(.*?)>(.*?)<\\/td>/iu', $y, $m)) {
                if (count($m[2]) == 6) {
                    $d = array();
                    $d['id'] = partof($m[2][0], '>', '</a>');
                    $d['link'] = $URL . str_replace('&amp;', '&', partof($m[2][0], '"', '"'));
                    $z = trim($m[2][1]);
                    $d['activity'] = empty($z) ? null : $z;
                    $d['disposition'] = partof($m[2][2], '>', '</a>');
                    $d['location'] = trim($m[2][3]);
                    $d['datetime'] = date('Y-m-d H:i:s', strtotime(trim($m[2][4])));
                    $d['notes'] = (bool) (strlen(trim($m[2][5])) > 1);
                    scraperwiki::save(array('id'), $d);
                }
            }
        }
    }
}
    $b = empty($start) ? 0 : strpos(strtolower($src), strtolower($start), 0);
    if ($b >= 0) {
        $b += $inclusive ? 0 : strlen($start);
        $e = empty($stop) ? strlen($src) : strpos(strtolower($src), strtolower($stop), $b);
        $e += $inclusive ? strlen($stop) : 0;
        $e = $e > strlen($src) ? strlen($src) : $e;
        if ($e > $b) {
            return trim(substr($src, $b, $e - $b));
        }
    }
}
$URL = 'http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3';
$x = scraperWiki::scrape($URL);
if (!empty($x)) {
    $x = partof($x, 'Officially assigned code elements</span></h3>', '<h3>');
    $x = partof($x, '<table', null, true);
    $x = explode('</table>', $x);
    if (count($x) > 0) {
        foreach ($x as $y) {
            $y = explode('</tr>', $y);
            if (count($y) > 0) {
                foreach ($y as $z) {
                    if (preg_match_all('/<td(.*?)>(.*?)<\\/td>/iu', $z, $m)) {
                        if (count($m[2]) == 2) {
                            $d = array('code' => trim(strip_tags($m[2][0])), 'label' => trim(strip_tags($m[2][1])));
                            scraperwiki::save(array('code'), $d);
                        }
                    }
                }
            }
        }
{
    $b = empty($start) ? 0 : strpos(strtolower($src), strtolower($start), 0);
    if ($b >= 0) {
        $b += $inclusive ? 0 : strlen($start);
        $e = empty($stop) ? strlen($src) : strpos(strtolower($src), strtolower($stop), $b);
        $e += $inclusive ? strlen($stop) : 0;
        $e = $e > strlen($src) ? strlen($src) : $e;
        if ($e > $b) {
            return trim(substr($src, $b, $e - $b));
        }
    }
}
$URL = 'http://en.wikipedia.org/wiki/ISO_4217';
$x = scraperWiki::scrape($URL);
if (!empty($x)) {
    $x = partof($x, 'Active codes</span></h2>', '</table>');
    $x = explode('</tr>', $x);
    if (count($x) > 0) {
        foreach ($x as $y) {
            if (preg_match_all('/<td>(.*?)<\\/td>/iu', $y, $m)) {
                if (count($m[1]) == 5) {
                    $d = array();
                    $d['code'] = trim($m[1][0]);
                    $z = trim($m[1][1]);
                    $d['number'] = $z == 'Nil' ? null : $z;
                    $z = trim($m[1][2]);
                    $z = $z == '.' ? null : $z;
                    $d['precision'] = strpos($z, '<') ? substr($z, 0, strpos($z, '<')) : $z;
                    $d['name'] = trim(strip_tags($m[1][3]));
                    $d['locations'] = trim(str_replace('  ', ' ', str_replace('&#160;', ' ', strip_tags($m[1][4]))));
                    scraperwiki::save(array('code'), $d);