BluRay release dates

By zenx on Jul 27, 2011

script.php?movie=Knowing

Source Code - Street Date: July 26, 2011
Source Code / Knowing - Street Date: July 26, 2011

Shows movies release dates (bluray)

As requested ( for irc bot ).

<?php

if(isset($_GET['movie'])) {
    $pdata = $_GET['movie'];
} else {
    die("");
}

if (strlen($pdata) < 5) { die("At least 5 letters in search."); }

$data = file_get_contents("http://bluray.highdefdigest.com/releasedates.html");
preg_match_all('/<li><b>.*<a href=\"http\:\/\/bluray\.highdefdigest\.com\/[0-9]+\/.*\.html\">.*<\/a>/', $data, $results);

foreach ($results[0] as $linkki) {
        preg_match('/http\:\/\/bluray.highdefdigest\.com\/[0-9]+\/.*\.html/', $linkki, $linkit[]);
        preg_match('/html\">.*<\/a>/', $linkki, $leffax);
        $leffa = str_replace('html">', '', $leffax[0]);
        $leffa = str_replace('</a>', '', $leffa);
        $leffatx[] = trim($leffa);
}

$paskaa = "-1";

$f = "0";

$checkki = "0";
foreach ($leffatx as $movie) {
$insidecheck = "0";
        $paskaa++;

    if (preg_match("/^$pdata/i", $movie)) {
        $neekeri[] = $movie;
        $checkki++;
    }

    if ($checkki == "4") {
        if ($_GET['all'] != "yes") {
            die("To see more results, goto: script.php?all=yes&movie=$pdata\n");
        }
    }

        if (preg_match("/^$pdata/i", $movie)) {
                $datelinkki = $linkit[$paskaa][0];
                $datedata = file_get_contents("$datelinkki");
                preg_match_all('/Street Date.*/', $datedata, $dateresults);
                if(isset($dateresults[0][0])) {
                        echo "$movie - ".$dateresults[0][0]."\n";
            $f = "1";
            $insidecheck = "1";
                }
        }
    if ($insidecheck != "1") {
        if (preg_match("/$pdata/i", $movie)) {
                $datelinkki = $linkit[$paskaa][0];
                $datedata = file_get_contents("$datelinkki");
                preg_match_all('/Street Date.*/', $datedata, $dateresults);
                if(isset($dateresults[0][0])) {
                        echo "$movie - ".$dateresults[0][0]."\n";
            $f = "1";
                }
        }
    }

}

if($f == "0") {
    echo " ".$pdata." returned 0 hits.";
}

?>

Comments

Sign in to comment.
Hawkee   -  Jul 28, 2011

You might want to look into Amazon AWS. It lets you get information about all the products on their site.

 Respond  
zenx   -  Jul 28, 2011

yeah but i didnt find one

 Respond  
Hawkee   -  Jul 27, 2011

Not bad, but this may break in the future if highdefdigest.com changes their format or wording. It's always best to rely on some sort of API for these sort of things.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.