1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Unable to run google api, library problems

Discussion in 'Google API' started by Bakamoo, May 23, 2011.

  1. #1
    Hello, I'm kinda stuck adding the library to be able to run the scripts

    http://code.google.com/apis/gdata/articles/php_client_lib.html
    http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/InstallationChecker.php <-- more direct link

    I'm using the installation checker found in the links above. I have it in my site.

    I then set
    
    $clientLibraryPath = '/home/newsho/public_html/Zend/library';
    //$clientLibraryPath = '/newsho/public_html/Zend/library';
    //$clientLibraryPath = '/public_html/Zend/library';
    //$clientLibraryPath = '/Zend/library';
    $oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath);
    Code (markup):
    I've tried all the codes with // and it still doesnt work
    I placed the code right after the "google license" before the line "class InstallationChecker {"

    Using the code with home, I get this error
    http://newshoole.com/checker.php <-- see for urself
    The website encountered an error while retrieving http://newshoole.com/checker.php. It may be down for maintenance or configured incorrectly.
    Here are some suggestions:
    Reload this web page later.
    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
    Code (markup):


    Using the others, i get this
    http://newshoole.com/checker2.php <-- see for urself


    My phpinfo is here
    http://newshoole.com/info.php


    I asked the help of the webserver tech team and they said this was the error log which i dont know how they got
    error_log now shows the following:
    
    [24-May-2011 00:18:40] PHP Warning:  require_once(Zend/Gdata/App/Extension/Element.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:18:40] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Zend/Gdata/App/Extension/Element.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/newsho/public_html/Zend/library') in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:18:48] PHP Warning:  require_once(Zend/Gdata/App/Extension/Element.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:18:48] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Zend/Gdata/App/Extension/Element.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/newsho/public_html/Zend/library') in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:18:51] PHP Warning:  require_once(Zend/Gdata/App/Extension/Element.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:18:51] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Zend/Gdata/App/Extension/Element.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/newsho/public_html/Zend/library') in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:19:15] PHP Warning:  require_once(Zend/Gdata/App/Extension/Element.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    [24-May-2011 00:19:15] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Zend/Gdata/App/Extension/Element.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/newsho/public_html/Zend/library') in /home/newsho/public_html/Zend/library/Zend/Gdata/App/FeedEntryParent.php on line 27
    Code (markup):
    Can anyone help me on this? Thanks alot
     
    Bakamoo, May 23, 2011 IP
  2. Bakamoo

    Bakamoo Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Or if you know how to use javascript, I just need a basic sample. Google complicates things too far. My javascript code is below, hope someone can help me at least retrieve my list of blogs, it retrieves if i use

    http://code.google.com/apis/blogger/docs/1.0/developers_guide_js.html#Interactive_Samples

    However, I cannot see the source code properly so, I'm just guessing again on how to retrieve. I don't understand whats supposed to be passed
    new google.gdata.blogger.BloggerService('GoogleInc-jsguide-1.0');
    Why googleinc-jsguide-1.0, i tried editing and i get the same results anyways
    and the PRINT function doesnt work either

    <html>
    <head>
    <!--<script type="text/javascript"
          src="http://www.google.com/jsapi?autoload=%7Bmodules%3A%5B%7Bname%3Agdata%2Cversion%3A2.x%2Cpackages%3A%5Bblogger%2Ccontacts%5D%7D%5D%7D"></script>-->
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
    
      // Load the latest version of the Google Data JavaScript Client
      google.load('gdata', '2.x');
    
      function onGoogleDataLoad() {
        // Put your code here
      }
    
      // Call function once the client has loaded
      google.setOnLoadCallback(onGoogleDataLoad);
    
    
    function logMeIn() {
      scope = "http://www.blogger.com/feeds";
      var token = google.accounts.user.login(scope);
      PRINT('Blog title: ');
      alert('test');
    }
    
    function setupMyService() {
      var myService = new google.gdata.blogger.BloggerService('GoogleInc-jsguide-1.0');
      logMeIn();
      return myService;
    }
    
    function listBlog()
    {
    /* 
     * Retrieve a list of blog posts
     */
    
    // Create the blogger service object
    var bloggerService = new google.gdata.blogger.BloggerService('GoogleInc-jsguide-1.0');
    
    // The feed URI ued to retrieve a list of blogs for a particular logged-in user
    var feedUri = 'http://www.blogger.com/feeds/default/blogs';
    
    // The callback method invoked when getBlogFeed() returns the list of our blogs
    var handleBlogFeed = function(blogFeedRoot) {
      var blogEntries = blogFeedRoot.feed.getEntries();
    
      // Get list of posts for each blog
      for (var i = 0, blogEntry; blogEntry = blogEntries[i]; i++) {
        var postsFeedUri = blogEntry.getEntryPostLink().getHref();
        var query = new google.gdata.blogger.BlogPostQuery(postsFeedUri);
    
        // Set the maximum number of blog posts to return
        query.setMaxResults(25);
        
        bloggerService.getBlogPostFeed(query, handleBlogPostFeed, handleError);
      }
    };
    
    // A callback method invoked getBlogPostFeed() returns data
    var handleBlogPostFeed = function(postsFeedRoot) {
      var posts = postsFeedRoot.feed.getEntries();
      
      // Display blog's title
      PRINT('Blog title: ' + postsFeedRoot.feed.getTitle().getText());
      
      for (var i = 0, post; post = posts[i]; i++) {
        var postTitle = post.getTitle().getText();
        var postURL = post.getHtmlLink().getHref();
     
        PRINT('post: <b><a href="' + postURL + '" target="_blank">' + postTitle + '</a></b>');
      }
      PRINT('');
    };
    
    var handleError = function(error) {
      alert(error);
    };
    
    bloggerService.getBlogFeed(feedUri, handleBlogFeed, handleError);
    }
    </script>
    </head>
    <body onload="loadGoogle();">
    
    <img src='bg.jpg' style="visibility:hidden; position:absolute; top:-1000px;"></img>
    <input type="button" onclick="setupMyService()" value="Sign In" />
    <input type="button" onclick="listBlog()" value="List" />
    </body>
    </html>
    Code (markup):
     
    Bakamoo, May 24, 2011 IP
  3. Bakamoo

    Bakamoo Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Got it to work by downgrading my zend version. Hopefully there wont be much problems by using such an old API.
     
    Bakamoo, May 24, 2011 IP