English 中文(简体)
B. 进入实验室
原标题:Accessing youtube services from php

我完全是新到的。 我正试图建立一个系统,把录像带上你管,并保存他们的URL。 另一项紧急呼吁后来合并。 我正在清除这个目标,以确保图书馆能够完成这些任务。

1) upload on a default channel 2) get video url 3) download video for offline viewing

我发现,有人使用的是厚生图书馆。 但面临许多问题。 我正在使用西澳大利亚合作署。 我把被zen为“C:wampwwwzend”的藏书图书馆复印件,并在此修改了php。

; Windows: "path1;path2" include_path = ".;C:wampwwwzendlibrary;c:phpincludes"

感觉没有变化。 因此,我试图用这一守则对图书馆进行测试。

<?php 
error_reporting(E_ALL);
ini_set( display_errors , 1);

set_include_path( C:/wamp/library/zend/library  . PATH_SEPARATOR . get_include_path());

require_once  zend/library/Zend/Gdata/YouTube.php ;
require_once  zend/library/Zend/Gdata/ClientLogin.php ;

require_once  zend/library/Zend/Loader/Autoloader.php ;
$autoloader = Zend_Loader_Autoloader::getInstance();

$authenticationURL=  https://www.google.com/youtube/accounts/ClientLogin ;
$httpClient = 
  Zend_Gdata_ClientLogin::getHttpClient(
              $username =  shabab.h.siddique@gmail.com ,
              $password =  *** ,
              $service =  youtube ,
              $client = null,
              $source =  testphp , 
              $loginToken = null,
              $loginCaptcha = null,
              $authenticationURL);



$developerKey =  AI3....w ;
$applicationId =  Student Collaborative Video System ;
$clientId =  Student Collaborative Video System ;

$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);

$yt->setMajorProtocolVersion(2);


$videoFeed = $yt->getVideoFeed(Zend_Gdata_YouTube::VIDEO_URI);
printVideoFeed($videoFeed);

var_dump($videoFeed);

?>

The错误一,目前见

1 0.0023 375392 {main}( ) .. estphp.php:0

2 0.0086 560192 require_once( C:wampwwwzendlibraryendGdataYouTube.php ) .. estphp.php:7

问题回答

你的法典对我做了罚款,我只得从<条码>zendlibrary调整到<条码>X:/zend/framework/library,当时我把这条路放在了我的PC上。 在建立包括进路时,确保充分利用该框架的道路。

然后,我需要具体列入我们将使用的Zentd_Gdata文档。 这里是行之有效的法典。

<?php 
set_include_path( X:/zend/framework/library  . PATH_SEPARATOR . get_include_path());

// we must manually require these since we didn t set up the autoloader
require_once  Zend/Gdata/YouTube.php ;
require_once  Zend/Gdata/ClientLogin.php ;

$authenticationURL=  https://www.google.com/youtube/accounts/ClientLogin ;
$httpClient = 
  Zend_Gdata_ClientLogin::getHttpClient(
              $username =  me@myemail.com ,
              $password =  mypass ,
              $service =  youtube ,
              $client = null,
              $source =  MySource , // a short string identifying your application
              $loginToken = null,
              $loginCaptcha = null,
              $authenticationURL);

$developerKey =  myprodkey ;
$applicationId =  TestProduct ;
$clientId =  Student Collaborative Video System ;
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$yt->setMajorProtocolVersion(2);
$videoFeed = $yt->getVideoFeed(Zend_Gdata_YouTube::VIDEO_URI);
//printVideoFeed($videoFeed);

var_dump($videoFeed);  // worked, printed out a list of videos in my app

替换

require_once  ZendLoader.php ;

iii

require_once  Zend/Loader/Autoloader.php ;
$autoloader = Zend_Loader_Autoloader::getInstance();




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签