views:

23

answers:

0

Hi,

I'm using the Zend Gdata Gbase Class in zend framework but I don't know where to start. Basically I will be uploading a zip file that contains a text file with the google feed format in the google merchant center to make my product items searchable online. My script will use a proxy site.

What basic tutorial link can you give in order for me to create a simple PHP script with gbase api to upload a zip file? Also, I'm thinking if I will have to parse the text file line per line and use zend gbase to add each item to the google merchant center or I will just upload the zip file and google will automatically unzip it, parse the the text file and add the records.

There's a lot of documentation out there but I'm confused at the moment finding the right approach or example code.

So far, I have this example code but haven't tested this yet:

<?php   
set_include_path('components/com_eventmanager/gdata/ZendGdata-1.0.0/library');
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Http_Client');

$user = $gmail_account;
$pass = $gmail_password;

$client = new Zend_Http_Client('https://www.google.com/', array(
    'adapter'      => 'Zend_Http_Client_Adapter_Proxy',
    'proxy_host'   => $proxy_host,
    'proxy_port'   => $proxy_port,
));

$authenticatedClient = Zend_Gdata_ClientLogin::getHttpClient(
    $user,
    $pass,
    Zend_Gdata_Calendar::AUTH_SERVICE_NAME,
    $client,
    'project-test-1.0'
);
?>

Thanks

Kind Regards, Mark