1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Google Zend GData OAuth 2.0

Discussion in 'Hire a Freelancer' started by baokydev, Jul 5, 2015.

  1. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    Hi, I been using Client::Login to access picasa web(google) using GData, Zend , Client Login.
    It been obsolete since may 2015 and have issue auth. Now they only allow OAuth 2.0 and I need help changing my code to work with the new OAuth 2.0

    There been several guide on Google but I not sure how to implement.

    Let me know if you are able to do it.


    Your code should allow the following


    1) I supply google email and pw
    2) I supply video file
    3) Your code should allow me to upload my video to Google Picasa web


    Below is part of my old code



    Code:
    
    
    
    $email = "[email protected]"; //some gmail email id
    $pass = "passw0rd"; // some password
    $albumid = "123456789012345678"; // some number
    
    
    
    
    $fileData = $folder . $videopath;
    $service = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
    $client = Zend_Gdata_ClientLogin::getHttpClient($email, $pass, $service);
    
    
    $fileType = CheckMime($fileData);
    $video =array(
    'file' => $fileData,
    'type' => $fileType,
    'name' => 'youtvideoname'
    );
    
    
    $gvideo = UploadVideo($client,$albumid,$video);
    
    
    
    function UploadVideo($client,$albumId, $video=array()){
        $videos = new Zend_Gdata_Photos($client);
    
    
        $fd = $videos->newMediaFileSource($video["file"]);
        $fd->setContentType($video["type"]);
    
    
        $entry = new Zend_Gdata_Photos_PhotoEntry();
        $entry->setMediaSource($fd);
        $entry->setTitle($videos->newTitle($video["name"]));
        $albumQuery = new Zend_Gdata_Photos_AlbumQuery;
        $albumQuery->setAlbumId($albumId);
        $albumEntry = $videos->getAlbumEntry($albumQuery);
        $result = $videos->insertPhotoEntry($entry, $albumEntry);
    
    
        if ($result) {
                    $UserQuery = new Zend_Gdata_Photos_UserQuery();
                    $userFeed = $videos->getUserFeed(null, $UserQuery);
                    foreach ($userFeed as $entry) {
                            if ($entry instanceof Zend_Gdata_Photos_AlbumEntry) {
                                    $user_id = $userFeed->getTitle();
                            }
                    }
                    $albumid = $result->getGphotoAlbumId()->getText();
                    $videoid =  $result->getGphotoId()->getText();
                    return "https://plus.google.com/u/0/photos/$user_id/albums/$albumId/$videoid";
        } else {
        echo "There was an issue with the file upload.";
        }
    }
    
    
    function CheckMime($fullPath){
        $path_parts = pathinfo($fullPath);
        $ext = strtolower($path_parts["extension"]);
        switch ($ext) {
          case "3gp": $ctype="video/3gpp"; break;
          case "avi": $ctype="video/avi"; break;
              case "txt": $ctype="video/quicktime"; break;
          case "mp4": $ctype="video/mp4"; break;
          case "mpeg": $ctype="video/mpeg"; break;
          case "xls": $ctype="video/mpeg4"; break;
          case "ppt": $ctype="video/msvideo"; break;
          case "asf": $ctype="video/x-ms-asf"; break;
          case "wmv": $ctype="video/x-ms-wmv"; break;
          default: $ctype="video/video/mp4";
        }
             return $ctype;
    }
    
    

    Let me know your TAT & price.
     
  2. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    Still looking for developer to get this done :)
     
  3. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    Up offer to 80usd.
     
  4. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    offer increase to $100 USD. whoever can code this can send me a p.m , sorry no deposit, must be tested before payment.
     
  5. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    up bid to $120 usd. whoever can code this can send me a p.m , sorry no deposit, must be tested before payment.

    Can check my history & iTrader, I deal thousands of dollars every month with SEO packages. won't run your $120 usd. I will pay whoever can solve my issue.

    Payment only via paypal.
     
  6. handmadebots

    handmadebots Senior Member

    Joined:
    Nov 8, 2012
    Messages:
    962
    Likes Received:
    217
    Home Page:
  7. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150

    That page you posted got video. its a bit lower than videos, the type of video I send in is mp4 format, 100mb file size limit is what I used to get.

    Its just the current auth method need to use oauth 2.0, i am okay with create a google developer account. as long someone can create a working code and tell me what to get.

    I can provide

    gmail user
    gmail pass
    video file path(local shared)
    if need me to signup any developer account to get some secret or api key, do let me know. i am fine with that as long the app can work (must be written in php) if not it must be written in a way where I can send in the argument by args command line and work with centos or ubuntu.

    and I want the return result of the picasa website to view the video (same as the example I shown above on post #1)

    Thanks


    Current offering $140 USD for this job.
     
  8. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    Set current offer to $150 usd for this code.
     
  9. baokydev

    baokydev BANNED BANNED

    Joined:
    Mar 11, 2014
    Messages:
    401
    Likes Received:
    150
    offer close. job done