Les nouveautés et Tutoriels de Votre Codeur | SEO | Création de site web | Création de logiciel

seo JavaScript Client Library for Google APIs Alpha version released 2013

Seo Master present to you:
author photo
Brendan
author photo
Antonio
By Brendan O’Brien and Antonio Fuentes, Google Developer Team

Today we reached another milestone in our efforts to provide infrastructure and tools to make it easier for developers to use Google APIs: we have released the Google APIs Client Library for JavaScript in Alpha. This client library is the latest addition to our suite of client libraries, which already includes Python, PHP, and Java.

This compact and efficient client library provides access to all the Google APIs that are listed in the APIs Explorer. The client library is also flexible, supporting multiple browser environments including Chrome 8+, Firefox 3.5+, Internet Explorer 8+, Safari 4+, and Opera 11+. In addition, the JavaScript client library supports OAuth 2.0 authorization methods.

You can load the client library using the following script tag:

<script src="https://apis.google.com/js/client.js?onload=CALLBACK"></script>

Loading an API and making a request is as easy as executing:

gapi.client.load('API_NAME', 'API_VERSION', CALLBACK);

// Returns a request object which can then be executed.
// METHOD_NAME is only available once CALLBACK runs.

var request = gapi.client.METHOD_NAME(PARAMETERS_OBJECT);
request
.execute(callback);

You can use the APIs Explorer to check all the methods available for an API, as well as the parameters for each method. For instance, use the above syntax with the plus.activities.search method of the Google+ API to query activities:


<!DOCTYPE html>
<html>
 <head>
 </head>

 <body>
   <script type="text/javascript">

function init() {

 // Load your API key from the Developer Console
 gapi.client.setApiKey('YOUR_API_KEY');

 // Load the API
 gapi.client.load('plus', 'v1', function() {
     var request = gapi.client.plus.activities.search({
         'query': 'Google+',
           'orderby': 'best'
           });

     request.execute(function(resp) {
         // Output title
         var heading = document.createElement('h4');
         heading.appendChild(document.createTextNode(
resp.title));
         var content = document.getElementById('content');
         content.appendChild(heading);

         // Output content of the response
         if (!resp.items) {
           content.appendChild(document.createTextNode(
'No results found.'));
         } else {
           for (var i = 0; i < resp.items.length; i++) {
             var entry = document.createElement('p');
           entry.appendChild(document.createTextNode(
resp.items[i].title));
             content.appendChild(entry);
           }
         }
       });
   });
}
   </script>
   <script src="https://apis.google.com/js/client.js?onload=init"></script>

   <div id="content"></div>
 </body>
</html>

To try this yourself, sign up in the Google APIs console or refer to the documentation on acquiring and using a developer key in the Google+ API.

The Google APIs Client Library for JavaScript is currently in Alpha, which means that we are actively developing it, but wanted to get the library in your hands as soon as possible, and we welcome any feedback to make the code better. While you can use the current library to start writing code, you should use caution when writing production code as library code changes may break your application. We are working hard to upgrade this release to Beta and beyond soon, and to release even more client libraries.

To get started, visit the JavaScript Client Library documentation page. We also welcome your feedback, which you can provide using the JavaScript client group.


Brendan O'Brien is a Software Engineer for the Browser Client group at Google. Prior to working on JavaScript APIs he was a frontend engineer for iGoogle. He is passionate about JavaScript and enjoys building web applications.

Antonio Fuentes is a Product Manager for the Google API Infrastructure group. He has experience launching products in the cloud computing, infrastructure, and virtualization space.

Posted by Scott Knaster, Editor
2013, By: Seo Master

seo Google APIs Client Library for Java: now with OAuth 2.0 2013

Seo Master present to you:
By Yaniv Inbar, Google APIs Client Team

During Google I/O 2011, we announced a major milestone by releasing the Beta version of the open source Google APIs Client Library for Java. This release included service-specific libraries and samples for Google APIs, built on our new client library generation infrastructure. Since that version 1.4 launch, we’ve been comfortable enough with the stability and features of the library that we want you to start building real production Java 5, Android, and Google App Engine applications and send us your feedback.

Today we are announcing a new milestone for the Java client library. With the version 1.5 release, we’re making available the open source Google OAuth Client Library for Java in Beta, with support for both OAuth 1.0a and OAuth 2.0. OAuth is an open standard for allowing a client application to securely gain access to a user’s private data stored on Google without ever asking for their password. Most Google APIs support OAuth 2.0, and we want to encourage adoption of OAuth 2.0 more widely on the web. That’s why we built this library to work with any API on the web -- not just Google APIs -- that comply with the OAuth specifications. Our current implementation of OAuth 2.0 is based on draft 10, but we will update it soon to the final draft, once it becomes an official standard. We encourage you to try it and send us your feedback.

Here is an example of how easy it is to use the OAuth 2.0 library to make a request using the library for the Google+ API (check out more samples):
// Set up the HTTP transport and JSON factory
HttpTransport httpTransport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();

// Set up OAuth 2.0 access of protected resources
// using the refresh and access tokens, automatically
// refreshing the access token when it expires

GoogleAccessProtectedResource requestInitializer =
new GoogleAccessProtectedResource(accessToken, httpTransport,
jsonFactory, clientId, clientSecret, refreshToken);

// Set up the main Google+ class
Plus plus = new Plus(httpTransport, requestInitializer, jsonFactory);

// Make a request to access your profile and display it to console
Person profile = plus.people().get("me").execute();
System.out.println("ID: " + profile.getId());
System.out.println("Name: " + profile.getDisplayName());
System.out.println("Image URL: " + profile.getImage().getUrl());
System.out.println("Profile URL: " + profile.getUrl());
Finally, we are making available a Beta version of the open source Google HTTP Client Library for Java. This is the common HTTP client library that the above two libraries are built on, and is built to work with any API on the web. It features a pluggable HTTP transport abstraction that allows it to work seamlessly on any of the supported Java platforms, support for efficient JSON and XML data models for parsing and serialization, and a pluggable JSON and XML parser so you can use whatever works best for you. Please try it and send us your feedback.

We are looking forward to finding out what you can build using these libraries on Google APIs. Please let us know how we can make the libraries easier to use and better suited for your needs.

As we announced at Google I/O 2010, we've been developing APIs that can provide descriptions of themselves via metadata. This new technique makes it easier to create and maintain client libraries that support more languages, work with more APIs, and are easier to use than ever before. This post announces one of several recent major milestones for our client libraries.


Yaniv Inbar is a Senior Software Engineer and Technical Lead of the Google APIs Client Libraries & Tools team. He is the lead developer of the open source Google APIs Client Library for Java. Yaniv has worked at Google for 5 years, and has a total of 12 years industry experience as a software engineer.

Posted by Scott Knaster, Editor
2013, By: Seo Master

seo Python Client Library for Google APIs is out of Beta 2013

Seo Master present to you:
Antonio
Joe

By Joe Gregorio and Antonio Fuentes, Google Developer Team

We have awesome news for Python developers. The Python Client Library for Google APIs is no longer in Beta! The Python Client Library has been augmented with many great features since its Beta launch. It now supports OAuth 2.0 service accounts, upload of media resources, batching of requests, asynchronous requests, resumable media upload, feed paging and many other features.

We encourage you to check out the new documentation for the client library, which not only has brand new content, but also has a slick new look and is now hosted on developers.google.com.

If you are building a Python application that uses Google APIs, we strongly recommend you use this client library. First, the library makes it simple to call any RESTful Google API and grab the data returned by the call. Also, the client library handles the OAuth 2.0 authentication protocol and all errors for you without the need to write any additional code.

Making a call to a RESTful API using the Google APIs Client Library for Python is simple. You start by constructing an http object to sign all requests with OAuth 2.0 credentials:

http = httplib2.Http()
http = credentials.authorize(http)


You then create a service object that knows how to talk to a Google API. In this example, we use the Google+ API:

service = build("plus", "v1", http=http)

You then access a collection of resources in the API by simply calling its name. The collection object that is returned has all the methods that a collection understands. Here we execute a GET request on the people collection passing the userID parameter:

person = service.people().get(userId='me').execute()
print "Your name is: %s" % person['displayName']


To get started, check out the documentation for the client library, which contains instructions for how to download and install it. As always, your feedback is welcome!


Joe Gregorio is a Software Engineer. In the past five years at Google he’s worked on APIs, Google App Engine, Google Wave, and now has come full circle and is back working on APIs.

Antonio Fuentes is a Product Manager focusing on developer-facing technologies. He has experience launching products in the cloud computing, infrastructure, and virtualization spaces.

Posted by Scott Knaster, Editor
2013, By: Seo Master

seo Google Plugin for Eclipse now provides richer tooling for Cloud SQL and Google APIs 2013

Seo Master present to you: Author PhotoBy Sriram Saroop, Product Manager

We are pleased to announce the latest release of Google Plugin for Eclipse (GPE 2.6) with improved tooling for Cloud SQL and Google APIs. GPE 2.6 introduces the following features:
Tooling for using Java Persistence API (JPA) to access Cloud SQL

Object-Relational Mapping (ORM) frameworks are very popular in the Java community for accessing relational databases. The Eclipse Web Tools Platform offers a robust set of tools to configure and use JPA with an implementation of your choice. With the new Google Plugin for Eclipse (GPE) 2.6, you can now take advantage of these tools with Cloud SQL and Google App Engine. In any GPE project, JPA can now be enabled and configured as a project facet. The screenshot below shows the JPA facet configuration for a GPE project.




Importing the latest Google APIs into your GPE project

With GPE 2.6, you now have access to all the latest Google APIs at the click of a button within Eclipse. You can now download the latest Google APIs Java client library with the required dependencies to access Google APIs right within your App Engine project using GPE. Update notifications for API version changes will appear in your App Engine project, so you can easily keep your client libraries updated all the time. The screenshot below shows the GPE UI for adding a Google API to a GPE project.




The next time we update the App Engine Engine SDK, you will be happy to see an update notification within Eclipse prompting you to update to the latest SDK.

Please go ahead and install GPE 2.6 by following the instructions here. You can start using the ORM tooling for Cloud SQL and the latest Google APIs for your App Engine projects. We always love to hear your feedback and the GPE group is a great place to share your thoughts.


Sriram Saroop is the Product Manager for the Google Plugin for Eclipse and the Google Admin APIs. He has been a software engineer in his previous life and he is now working toward creating an awesome developer experience for Google products.

Posted by Scott Knaster, Editor
2013, By: Seo Master
Powered by Blogger.