Beispiel #1
0
<?php

include 'iTunes.php';
$iTunes = new iTunes();
$result = $iTunes->search(array('term' => 'Taylor Swift', 'media' => 'music'));
?>
    <table>
        <tr>
            <th>Artist Name</th>
            <th>Track Name</th>
            <th>Album</th>
        </tr>

        <?php 
foreach ($result->results as $data) {
    ?>
            <tr>
                <td> <?php 
    echo $data->artistName;
    ?>
 </td>
                <td> <?php 
    echo $data->trackName;
    ?>
 </td>
                <td> <?php 
    echo $data->collectionName;
    ?>
 </td>
            </tr>
        <?php 
<?php

include_once "php_includes/movie_data.php";
function umlautepas($string)
{
    $upas = array("ae" => "ä", "ue" => "ü", "oe" => "ö", "Ae" => "Ä", "Ue" => "Ü", "Oe" => "Ö");
    return strtr($string, $upas);
}
$row = getRow();
$itunes = iTunes::search($row[5], array('country' => 'US', 'entity' => 'movie'))->results;
$available = 0;
$trackPrice = 0;
$trackRentalPrice = 0;
if (count($itunes) > 0) {
    echo "original";
    for ($i = 0; $i < count($itunes); $i++) {
        $itunesdate = $itunes[$i]->releaseDate;
        $itunesyeararray = explode("-", $itunesdate);
        $itunesyear = $itunesyeararray[0];
        @($pos = strpos($itunes[$i]->trackName, $row[5]));
        //Fehler wegen ->undefinded property stdclass->trackname
        $posdir = strpos($itunes[$i]->artistName, getDirector($row));
        //echo $posdir;
        if (getDirector($row) === $itunes[$i]->artistName && $row[5] === $itunes[$i]->trackName) {
            $rows = $i;
            $available = 1;
            echo "1";
            break;
        }
        if (getDirector($row) === $itunes[$i]->artistName) {
            $rows = $i;