Foros del Web » Programando para Internet » PHP »

Subir archivo a Picasa con api

Estas en el tema de Subir archivo a Picasa con api en el foro de PHP en Foros del Web. Hola, necesito una mano para poder subir con php un archivo a picasa, por internet hay muy poca info, y en la web de picasa ...
  #1 (permalink)  
Antiguo 01/06/2011, 18:16
Avatar de hackcrack  
Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años
Puntos: 9
Subir archivo a Picasa con api

Hola, necesito una mano para poder subir con php un archivo a picasa, por internet hay muy poca info, y en la web de picasa no entiendo un pomo como hacerlo porq no lo veo muy bien explicado, el codigo esta muy dividido y me termino perdiendo..

Tengo esto, pero me da error:

Código PHP:
<?php
$serviceName 
Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$user "mi user";
$pass "mi pass";

$client Zend_Gdata_ClientLogin::getHttpClient($user$pass$serviceName);

// update the second argument to be CompanyName-ProductName-Version
$gp = new Zend_Gdata_Photos($client"Google-DevelopersGuide-1.0");

// In version 1.5+, you can enable a debug logging mode to see the
// underlying HTTP requests being made, as long as you're not using
// a proxy server
// $gp->enableRequestDebugLogging('/tmp/gp_requests.log');

$username "hackcrack";
$filename "http://imghackcrack.files.wordpress.com/2011/06/descarga.png";
$photoName "My Test Photo";
$photoCaption "The first photo I uploaded to Picasa Web Albums via PHP.";
$photoTags "beach, sunshine";

// We use the albumId of 'default' to indicate that we'd like to upload
// this photo into the 'drop box'.  This drop box album is automatically 
// created if it does not already exist.
$albumId "default";

$fd $gp->newMediaFileSource($filename);
$fd->setContentType("image/jpeg");

// Create a PhotoEntry
$photoEntry $gp->newPhotoEntry();

$photoEntry->setMediaSource($fd);
$photoEntry->setTitle($gp->newTitle($photoName));
$photoEntry->setSummary($gp->newSummary($photoCaption));

// add some tags
$keywords = new Zend_Gdata_Media_Extension_MediaKeywords();
$keywords->setText($photoTags);
$photoEntry->mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
$photoEntry->mediaGroup->keywords $keywords;

// We use the AlbumQuery class to generate the URL for the album
$albumQuery $gp->newAlbumQuery();

$albumQuery->setUser($username);
$albumQuery->setAlbumId($albumId);

// We insert the photo, and the server returns the entry representing
// that photo after it is uploaded
$insertedEntry $gp->insertPhotoEntry($photoEntry$albumQuery->getQueryUrl()); 
?>
  #2 (permalink)  
Antiguo 01/06/2011, 19:49
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: Subir archivo a Picasa con api

¿Que error?
  #3 (permalink)  
Antiguo 01/06/2011, 20:29
Avatar de hackcrack  
Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años
Puntos: 9
Respuesta: Subir archivo a Picasa con api

me dice que no enctro una clase, pero igual creo q le mande fruta en ese codigo noc si esta bien planteado para subir un archivo

Etiquetas: api, picasa
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:52.