Thursday, April 15, 2010

[Gd] A New Approach to Printing

| More

Chromium Blog: A New Approach to Printing

When we demonstrated Google Chrome OS last Fall, a few folks asked us how it would handle printing. Today we wanted to give developers a little more insight into our approach for printing from Chrome OS and other web-connected platforms.

While the emergence of cloud and mobile computing has provided users with access to information and personal documents from virtually any device, today’s printers still require installing drivers which makes printing impossible from most of these new devices. Developing and maintaining print subsystems for every combination of hardware and operating system-- from desktops to netbooks to mobile devices -- simply isn't feasible.

Since in Google Chrome OS all applications are web apps, we wanted to design a printing experience that would enable web apps to give users the full printing capabilities that native apps have today. Using the one component all major devices and operating systems have in common-- access to the cloud-- today we're introducing some preliminary designs for a project called Google Cloud Print, a service that enables any application (web, desktop, or mobile) on any device to print to any printer.

Rather than rely on the local operating system (or drivers) to print, apps can use Google Cloud Print to submit and manage print jobs. Google Cloud Print will then be responsible for sending the print job to the appropriate printer with the particular options the user selected, and returning the job status to the app.

Google Cloud Print is still under development, but today we are making code and documentation public as part of the open-source Chromium and Chromium OS projects. While we are still in the early days of this project, we want to be as transparent as possible about all aspects of our design and engage the community in identifying the right set of open standards to make cloud-based printing ubiquitous. You can view our design docs and outlines here and we hope you stay tuned for updates in the coming months.

Posted by Mike Jazayeri, Group Product Manager

[Gd] [Feed][Update] feedUrl added to JSON output

| More

Google AJAX API Alerts: [Feed][Update] feedUrl added to JSON output

A field, feedUrl, has been added to the JSON output of the Feed API.

[Gd] Webmasters - configure Google services at your hosting panel

| More

Official Google Webmaster Central Blog: Webmasters - configure Google services at your hosting panel

Webmaster Level: All

Today, as announced on the Official Google Blog, we’ve taken an additional step to improve access to Google webmaster services. Parallels, one of the leading providers of control panel software to hosting companies, has integrated Google Services for Websites into Parallels Plesk Panel, used by millions of website owners globally to manage their websites.

If you use Plesk for managing your hosting and website services, you can easily configure Webmaster Tools, Custom Search, Site Search, Web Elements and AdSense for your website right from within Plesk.

Since Plesk knows what domains you own, it automatically registers your domains to Webmaster Tools and allows you to automatically login to the Webmaster Tools console to verify your sites, as shown below.

We’re always trying to make our tools easier to use and easier to access. Since you’re probably visiting your hosting control panel on a regular basis, we hope that you find this integration convenient. If you have feedback please let us know in the Webmaster Forum.

Posted by Jonathan Simon, Webmaster Trends Analyst

[Gd] Custom Search now available in Parallels Plesk Panel

| More

Google Custom Search: Custom Search now available in Parallels Plesk Panel

Website owners who use Parallels Plesk Panel to manage their hosting and website services can now configure Custom Search and Site Search in a couple of clicks! As announced on the Google Blog, Plesk now offers out-of-box integration with Google Services for Websites.

If you’re one of the millions of webmasters already using Plesk Panel, you can now easily add high-quality search to your websites via the Custom Search page shown above. Since Plesk Panel knows what domains you own, a drop-down list of your domains is conveniently offered for automatic configuration of the search engine, as shown below.

Once you’re done configuring your search engine, you can customize the search experience to match the look and feel of your website. As shown in the screenshot below, Plesk provides links that you can click to directly manage and customize your search engine with the Custom Search control panel -- you will be automatically logged in.

After you decide on the theme and layout for your search, you can get the search code to insert into your website so your users can easily find what they are looking for. Finally, you can also click through from Plesk to access your search statistics. If you want support and more control over advertising, branding, and indexing, you can initiate an upgrade to Site Search right from within Plesk.

We hope this will make it easier for you to manage your site search experience. As always, let us know if you have feedback.

Posted by: Radu Cornea, Software Engineer and Jae Jung, Business Development Manager

Wednesday, April 14, 2010

[Gd] Discover v2009: Error handling

| More

AdWords API Blog: Discover v2009: Error handling

As with any programming system, error handling is a critical part of the AdWords API as well. In v13, we used to describe every error by its own error code. While this was simple and handy, the API provided less additional information about the error itself. In v2009, we decided instead to use error types with additional fields to describe the specifics of each error. The new error handling system gives you the type of error (e.g. PolicyViolationError), the cause of error (e.g. the editorial policy that was violated), the field that triggered the error and so forth. In this blog post, I'll cover the v2009 error handling in detail, with focus on v2009 synchronous services.

Error handling in v13 and v2009 APIs

To show the difference in error handling between v13 and v2009, consider the following v13 code to create a campaign.

try {
AdWordsUser user = new AdWordsUser();
CampaignInterface service =
(CampaignInterface) user.getService(AdWordsService.V13.CAMPAIGN_SERVICE);
Campaign campaign = new Campaign();
campaign.setName("New campaign");
campaign = service.addCampaign(campaign);
} catch (ApiException e) {
for (ApiError error : e.getErrors()) {
System.out.println("There is an error on argument " + error.getIndex()
+ ". Error code is " + error.getCode()
+ ", details are \"" + error.getDetail()
+ "\", field is " + error.getField());

This code generates the following output:

There is an error on argument 0. Error code is 34, details are "Money amount less than CurrencyMinCpc.", field is budget.

The same code in v2009 is given below:

try {
user = new AdWordsUser();
CampaignServiceInterface service = (CampaignServiceInterface)
Campaign campaign = new Campaign();
campaign.setName("New campaign");
campaign.setBiddingStrategy(new ManualCPC());
campaign.setBudget(new Budget(BudgetBudgetPeriod.DAILY,
new Money(null, 50L), BudgetBudgetDeliveryMethod.STANDARD));
CampaignOperation operation = new CampaignOperation();
campaign = service.mutate(new CampaignOperation[] {operation}).getValue()[0];
} catch (ApiException e) {
for (ApiError error : e.getErrors()) {
System.out.println("There is an error on argument " + error.getFieldPath()
+ ".");
if (error instanceof BudgetError) {
BudgetError budgetError = (BudgetError) error;
System.out.println("Reason is " + budgetError.getReason());

The code generates the following output:

There is an error on argument operations[0].operand.budget. Reason is NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT.

As shown in the code above, v2009 returns an error object derived from ApiError, with an appropriate error reason that gives more insight into why the error occurred. This allows you to write a switch-case to handle error categories and reasons that are significant for your program more elegantly than in v13. Also, the list of exceptions raised by a service are available along with the service documentation. For instance, all the exceptions that can possibly be raised by CampaignService are listed at

Retrieving the violating field using FieldPath

FieldPath is another useful item you get from a v2009 error. FieldPath stores the OGNL path to the field that caused the violation. OGNL stands for Object-Graph Navigation Language; it is an expression language for getting and setting properties of objects. You can use it as a debugging aid while developing your application, retrieve the value of the violating field, etc. For instance, the following code shows how to retrieve the value of budget that caused the error using the library from opensymphony.

try {
OgnlContext ognlContext = new OgnlContext();
ognlContext.put("operations", operations);
Object value = Ognl.getValue(error.getFieldPath(), ognlContext);
System.out.println("Violating field is " + error.getFieldPath()
+ " and value is " + value);
} catch (OgnlException e) {

This code will print the output as

Violating field is operations[0].operand.budget and value is 50.

In case you are interested in just the index of the violating operation, you can evaluate it using a simple regex as follows:

public static int getOperationsIndex(String ognl) {
String OPERATIONS_INDEX_REGEX = "^operations\\[(\\d+)\\]";
Matcher m = Pattern.compile(OPERATIONS_INDEX_REGEX).matcher(ognl);
if (m.find()) {
return Integer.parseInt(;
} else {
return -1;

Validating API calls using validateOnly

AdWords API also allows you to validate your API calls to see if the request will generate any errors or not. You can validate any API call by setting the validateOnly SOAP header to true and making the API call as usual. If the request contains errors, you will get ApiError objects. If the request is fine, no errors are thrown, and the API call doesn't perform any action either. In addition to providing a way to validate your API calls, validateOnly is significantly cheaper than normal calls. You can refer to the rate sheet to calculate how many API units a validateOnly call will cost you. For more details on how to use validateOnly headers, you can refer to our blog post here

In our next blog post, we will cover how v2009 error handling works in BulkMutateJobService. We've included support for error handling in all of our client libraries to help get you started, so please try it out and share your feedback with us on the forum.

-- Anash P. Oommen, AdWords API Team

[Gd] Rendering custom data in the Custom Search element

| More

Google AJAX APIs Blog: Rendering custom data in the Custom Search element

Last year we introduced Rich Snippets in Custom Search, allowing you to define your own custom attributes that we'll index and return with your custom search results. A few months later we showed you how to render some of these rich snippets in your Custom Search element. Sure, this was a powerful way to let your visitors see thumbnails or interact with the results via actions. But we felt it was still too constrained. It is with great pleasure that today we're announcing that you now have full rendering control of all your metadata in the Custom Search element.

What do I mean? If a picture is worth a thousand words, an example is worth a thousand pictures. Here's a fully customized element, showcasing results and metadata from
By  -  pages -  views  - last modified 

The results really jump out at you, huh? The thumbnails really help users see what they're looking at, but we've shown you those before. Same with the Download action links by each result. But never before could you include arbitrary, per-result metadata with your Google Custom Search results so easily. Notice the author, length, views and date information in each result. There's even an icon representing each result's document type.

So how can you add this to your page? Let's take a look.

First, you need to include custom attributes within your webpages, either via microformats, RDFa, or a special markup called PageMaps. A PageMap identifies specific attributes that Google recognizes and indexes, and then returns along with search results. Our prior blog post on Structured Custom Search tells you how to add PageMaps to your site. Please keep in mind that your site needs to be re-indexed, which can take some time. Therefore, your PageMaps might not show up immediately.

Once your custom attributes have been indexed, you're ready to tell the element how to render them. If you don't already have the element on your page, you can add it with a few lines:
<script src="" type="text/javascript"></script>
<script type="text/javascript">
// Load the Search API
google.load('search', '1');

// Set a callback to load the Custom Search Control when you page loads
<div id="cse"></div>
Here's the sample, with only the default rich snippet inclusion:

It looks okay, but let's make it better.

We have to override the default rendering, by adding this line to the onLoadCallback:"mysite_");
Now, create a div to hold all of the rendering information - put it right above the div that the element uses:
<div style="display:none">
Okay, now that everything's set up, it's time for the good part. First off, let's try shrinking the thumbnails a bit. Inside the div that was just added above, and tell the element to render the images at 48x48 pixels:
<div id="mysite_thumbnail">
<div data-if="Vars.thumbnail" class="gs-image-box gs-web-image-box">
<a class="gs-image" data-attr="{href:url, target:target}">
<img class="gs-image" data-attr="{src:thumbnail.src, width:48, height: 48}"/>
This replaces the default thumbnail rendering code with a similar version that sets the image dimensions directly.

Here's the same sample with the above code added:
Now it's time to add the new content and tweak the rendering of the basic content, too:
<div id="mysite_webResult">
<div class="gs-webResult gs-result"
data-vars="{longUrl:function() {
var i = unescapedUrl.indexOf(visibleUrl);
return i < 1 ? visibleUrl : unescapedUrl.substring(i);}}">

<td valign="top">
<div data-if="Vars.richSnippet" data-attr="0"

<td valign="top">
<div class="gs-title">
<a class="gs-title" data-attr="{href:unescapedUrl,target:target}"
<div class="gs-snippet" data-body="html(content)"></div>
<div class="gs-visibleUrl gs-visibleUrl-short" data-body="longUrl()"></div>
<div style="& Vars.richSnippet.document">
<img data-attr="{src:Vars.richSnippet.document.filetypeImage}">
By <span data-body=""></span> -
<span data-body="Vars.richSnippet.document.pageCount"></span> pages -
<span data-body="Vars.richSnippet.document.viewCount"></span> views
- last modified <span data-body="Vars.richSnippet.document.timeAgo"></span>

<div data-if="Vars.richSnippet && Vars.richSnippet.action" class="gs-actions"
Voila! The sample is now complete, and here's how it looks:

This example is a bit more complex. It shows how to use the render() function to call other code, and also how you can include any JavaScript logic. You can even define internal functions, such as longUrl().

Didn't quite catch all of that or want to do even more? Check out the documentation.

The best part of announcing new features like this is seeing what innovative implementations people come up with. Don't keep us waiting - come show off your handiwork in our support forum or IRC channel!
Posted by: David Gibson, Software Engineer and Adam Feldman, Product Manager

[Gd] Custom data rendering in results

| More

Google Custom Search: Custom data rendering in results

Since the launch of Custom Search, we've been constantly pushing the customization envelope -- allowing users to tweak ranking, provide refinements, add promotions above results, change the look and feel, select from themes and modify layouts.

We did not stop there. We added support for custom synonyms, and the ability for website owners to mark up their content with structured metadata. With structured Custom Search, you can create results with rich snippets, e.g., thumbnails and actions.

Now, through Custom Search data rendering in the element, we’re providing you the ability to completely customize the layout of each result. With simple inline markup on the search page, you can override result attributes, decide how each result is formatted, control the size and location of thumbnails and highlight result metadata.

The screenshot below shows an example of formatted result blocks for a sample search based on data from Scribd -- thumbnails have been reduced in size, and a new line containing metadata, including an icon for document type, has been inserted into the result.

We hope you’ll use the power of data rendering in your own search. For a step by step guide on how you can control the data rendering in results with the Custom Search Element, please read our post on the Search API blog.

Posted by: David Gibson and Nicholas Weininger, Software Engineers

[Gd] More data and charts in Top Search Queries

| More

Official Google Webmaster Central Blog: More data and charts in Top Search Queries

Webmaster Level: All

We've got good news for site owners who are frequent users of the Top search queries feature in Webmaster Tools: we’re now providing more detailed data for each individual search query. We previously just reported the average position at which your site’s pages appeared in the search results for a particular query. Now you can click on a given search query in the Top search queries report to see a breakdown of the number of impressions and the amount of clickthrough for each position that your site’s pages appeared at in the search results associated with that query. Impressions are the number of times that your site’s pages appeared in the search results for the query. Clickthrough is the number of times searchers clicked on that query’s search results to visit a page from your site. In addition to impressions and clickthrough numbers, you’ll also see a list of your site's pages that were linked to from the search results for that search query. As we went about increasing the amount of data available, we also implemented measures to increase the detail of the data overall.

It used to be that you could only see Top search queries data for your site's top 100 queries. We’ve significantly increased the number of queries we show. Now if your site ranks for more than 100 queries, you’ll see new pagination buttons at the bottom of the Top Search Queries table allowing you to page through a much larger sampling of the queries that return your site in search results.

Previously, if you wanted to visualize your Top search queries data you could download your site's data and generate your own charts. To save you some time and effort, we're now generating a chart for you, and displaying it right within the page.

The Top search queries chart includes a date range selector similar to what Google Analytics offers. So now if you really want to see what your site's top search queries were for a particular week in the past, you can see the data for just that slice in time.

Finally, for sites that have numerous keywords that change frequently, we’ve added the ability to search through your site’s top search queries so that you can filter the data to exactly what you’re looking for in your query haystack.

We hope you enjoy these updates to the Top search queries feature and that it's even more useful for understanding how your site appears and performs in our search results. If you've got feedback or questions about the new Top search queries, please share your thoughts in our Webmaster Help Forum.

Written by Jonathan Simon, Webmaster Trends Analyst

[Gd] Technically speaking, what makes Google Chrome fast? (Part II)

| More

Chromium Blog: Technically speaking, what makes Google Chrome fast? (Part II)

If you’ve dug around the many graphs that are displayed when you type “about:histograms” into Chrome’s Omnibox, you’ll notice that we’re still obsessed about measuring, benchmarking, and improving speed and performance on the browser.

Previously, we published a series of video interviews on several key engineering pieces that go into designing a fast, responsive modern browser, namely DNS pre-resolution, the V8 JavaScript engine, and DOM bindings.

In this next installment of technical interviews on Chrome’s speed, we’ll dive into two more areas that contribute to Chrome’s speed: UI responsiveness and WebKit.

with James Robinson

1. What is WebKit?
2. How does WebKit contribute to Chrome's speed?
3. Tell us more about current and future work on WebKit and Chrome
4. Tell us more about new WebKit APIs that can further improve performance
5. What are the challenges of developing a new API for the web?
6. Tell us more about optimizing performance hotspots in WebKit, such as strings and repainting

UI responsiveness
with Peter Kasting

1. What is UI responsiveness?
2. What are examples of UI responsiveness in Chrome?
3. How does multi-threading improve UI responsiveness?
4. Tell us about how the backing store cache improves UI responsiveness?
5. How do you benchmark UI responsiveness?
6. How does Chrome's simplicity contribute to a responsive UI experience?
7. What are future plans to further improve UI responsiveness?
8. What motivates you to work on UI responsiveness?

Posted by Min Li Chan, Product Marketing Manager

[Gd] [Search][New] Data rendering in the Custom Search element

| More

Google AJAX API Alerts: [Search][New] Data rendering in the Custom Search element

We've added data rendering to the Custom Search element:

Tuesday, April 13, 2010

[Gd] Better recipes on the web: Introducing recipe rich snippets

| More

Official Google Webmaster Central Blog: Better recipes on the web: Introducing recipe rich snippets

Webmaster Level: All

Anticipating the start of the season of barbecues and potlucks, we’ve added recipes as our newest rich snippets format. This means that for certain sites with recipes content, Google users will see quick facts when these recipe pages show up as part of the search results.

For example, if you were searching for an easy to make thai mango salad, you can now see user ratings, preparation time, and a picture of the dish directly in search result snippets.

Recipes is the fifth format we support, following the introduction of reviews, people, video and, most recently, events.

If you have recipe content on your site, you can get started now by marking up your recipes with microdata, RDFa, or the hRecipe microformat. To learn more, read our documentation on how to mark up recipe information or our general help articles on rich snippets for a more complete overview.

Please remember that to ensure a great user experience we’re taking a gradual approach to surface rich snippets. This means that we can’t guarantee that marking up your site will result in a rich snippet when your page shows up on our search results. However, we encourage you to get started, and once you’re done you can test your pages with our rich snippets testing tool.

Written by Jun Gong, Kosuke Suzuki, and Yu Watanabe

[Gd] Google Buzz buttons for your site

| More

Google Code Blog: Google Buzz buttons for your site

If you’ve thought about adding Google Buzz buttons to your site, but didn’t want to have to hack together something the way Mashable and TechCrunch did, you’re in luck. Starting today you can grab official Buzz buttons from

From there, you can do some basic customization of the buttons, including specifying the content that will be included when users post. When you configure the URL option for your button, we’ll use that URL to include a preview of the page based on its title and meta description tags. If you don’t specify a link, we’ll take our best guess by including the page on which you placed the button. Likewise, when you set up an image URL, we’ll add a thumbnail of that image to the post your users create. If you prefer to set up your buttons by hand, these options and more are also available through our JavaScript API -- for more details, check out our spec.

By Alison Cichowlas, Software Engineer

[Gd] Restricting by licenses now available in the Image Search API

| More

Google AJAX APIs Blog: Restricting by licenses now available in the Image Search API

I'm always amazed at the creative ways developers use Google's APIs. I'm always pleased when we are able to add a new feature to the API, as I know that someone, somewhere will do something cool and unexpected with it. The latest addition is to the Image Search API. You can now restrict results by various licenses applied to each image.

There are two different ways to use this feature. In the JavaScript API, you can restrict your results to one of four common licenses (just like on Google Image Search). This is done using the setRestriction method, after creating your Image Search searcher. Here's how to restrict to images which have been labeled for reuse with modification:
var searcher = new;
You can experiment with a live example of this in our Code Playground.

If you're using the JSON API, you can use the as_rights optional parameter to tell the API to include or exclude certain attributions. To perform the same restriction as above, try adding this to your requests:
For a full list of the attribute combinations for each type of license, perform an appropriately restricted search on Google Image Search's advanced search and take a look at the as_rights parameter in the URL on the results page.

Note: Images returned with this filter may still have conditions on the license for use. Please remember that violating copyright is strictly prohibited by the API Terms of Use. For more details, see this article.

Please come visit our IRC channel and support forum and let us know how you've used this feature in your site or app!

Monday, April 12, 2010

Sunday, April 11, 2010

[Gd] 10 New Articles; 10 More Ways to Learn the Google Wave APIs

| More

Google Wave Developer Blog: 10 New Articles; 10 More Ways to Learn the Google Wave APIs

We've added 10 new articles to the documentation, written by both the Google Wave API team and developers like you, and we hope these articles will give you a new way of understanding how to use the APIs.

After launching the new robots API a month ago, robot developers have already written a bunch of articles about using it in various ways, from developing in Eclipse to integrating with Salesforce:

Meanwhile, gadget developers have been spreading their knowledge on writing gadgets, with articles on everything from Flex to GWT:

If you wrote an article yourself, please share it in the forum. Happy reading!

Posted by Pamela Fox, Developer Relations