示例#1
0
function GetMoviesByLanguage()
{
    $language = CheckPost('Language');
    $netflix = new NetflixCatalog();
    $settings = parse_ini_file("app.config", 1);
    if (!empty($settings["HTTP_PROXY_HOST"])) {
        $netflix->HttpProxy = new HttpProxy($settings["HTTP_PROXY_HOST"], $settings["HTTP_PROXY_PORT"], $settings["HTTP_PROXY_USER_NAME"], $settings["HTTP_PROXY_PASSWORD"]);
    }
    $query = $netflix->Languages()->Filter("Name eq '{$language}'")->Expand('Titles');
    $movies = $query->Execute();
    ShowExpansion($movies->Result);
}
示例#2
0
文件: index.php 项目: zzzaaa/odataphp
        </script>
    </head>
    <body bgcolor="b9090b">
      <form name="searchForm" method="POST" action="search.php">
      <?php 
require_once 'netflix.php';
session_start();
$_SESSION["token"] = null;
try {
    $netflix = new NetflixCatalog();
    $settings = parse_ini_file("app.config", 1);
    if (!empty($settings["HTTP_PROXY_HOST"])) {
        $netflix->HttpProxy = new HttpProxy($settings["HTTP_PROXY_HOST"], $settings["HTTP_PROXY_PORT"], $settings["HTTP_PROXY_USER_NAME"], $settings["HTTP_PROXY_PASSWORD"]);
    }
    $queryGenres = $netflix->Genres();
    $queryLanguages = $netflix->Languages();
    $_SESSION["current"] = 0;
    function GetGenres($query, $netflix)
    {
        $genres = $query->Execute();
        echo "\n<option value='Undecided'>Undecided</option>";
        $token = null;
        do {
            if ($token != null) {
                $genres = $netflix->Execute($token);
            }
            foreach ($genres->Result as $genre) {
                echo "\n<option value='" . $genre->Name . "'>{$genre->Name}</option>";
            }
        } while (($token = $genres->GetContinuation()) != null);
    }