WorryFree Computers   »   [go: up one dir, main page]

We recently added a new feature to Apps Script: the ability to interact with your Google Docs List. With this new integration, scripts can create, rename, or move files and folders in your Google Docs. In addition, scripts can now create, modify, and clear plain-text files and search through your documents for a specified query string.

For instance, take a company whose website is hosted on Google Sites. They have a Specials page where they want to list seasonal sales depending on upcoming holidays. They store the details about the seasonal sales in plain-text files that are saved in their Google Docs List. By using the Google Docs List and and Sites services within Apps Script along with time-based triggers to run the script once per day, they can keep their Specials page updated automatically. Here’s a code snippet that demonstrates how to update the Specials page:


//The Mother’s Day sale runs from May 1 - May 7, 2011
var MOTHERS_DAY_START = new Date("May 1, 2011");
var MOTHERS_DAY_END = new Date("May 7, 2011");
//The Valentine’s Day sale runs from Feb 6 - Feb 13, 2011
var VALENTINES_DAY_START = new Date("February 6, 2011");
var VALENTINES_DAY_END = new Date("February 13, 2011");

function updateSpecials() {
var today = new Date();
var site = SitesApp.getSite("example.com", "giftshop");
// Get all the web pages in the Site
var pages = site.getWebPages();
// Loop through the web pages to find the specials page
for (var i = 0; i < pages.length; i++) {
if (pages[i].getPageName() == "specials") {
var page = pages[i];
}
}
// Set up the default wording for the specials page
var pageText = "There are no specials at this time.";

// If today’s date is within the Mother’s Day sale range
if (today >= MOTHERS_DAY_START && today <= MOTHERS_DAY_END) {
// Find the sale text that’s stored in the file mom.txt
pageText = DocsList.find("mom.txt")[0].getContentAsString();
}
// If today’s date is within the Valentine’s Day sale range
else if (today >= VALENTINES_START && today <= VALENTINES_END ) {
// Find the sale text that’s stored in the file valentines.txt
var pageText = DocsList.find("valentines.txt")[0].getContentAsString()
}
// Set the content of the specials page
page.setContent(pageText);
}​




If this script is then set up to run using a trigger that calls it at the same time each day, then the Specials page will be kept automatically up-to-date.

To help you learn more, we've created a tutorial that demonstrates how to search and display information about files, create files, and read content from files.

Note that certain features of the DocsList service, such as creating files, are only available to Google Apps accounts. For complete information on interacting with your Google Docs List using Apps Script, see the DocsList Service documentation.

We look forward to seeing how you use this integration. If you'd like to learn more about Apps Script and meet the Apps Script team in person, join us at the upcoming Apps Script hackathon in New York City on June 24.

As businesses move to the cloud, there’s a growing demand for core services such as storage that power cloud applications. Today we are introducing a preview of Google Storage for Developers, a RESTful cloud service built on Google’s storage and networking infrastructure.

Using this RESTful API, developers can easily connect their applications to fast, reliable storage replicated across several US data centers. It is highly scalable - supporting read-after-write data consistency, objects of hundreds of gigabytes in size per request, and a domain-scoped namespace. In addition, developers can manage their storage from a web-based interface and use GSUtil, an open-source command-line tool and library.

Google Storage is designed for sharing and collaboration, with built-in authentication services and access controls based on Google Accounts. This makes it easy to control which users have access to what information in your internal and external applications. Right now Google Storage only supports standard Google Accounts, but we’re working hard to add support for Google Apps accounts.

We are introducing Google Storage for Developers to a limited number of developers at this time. During the preview, each developer will receive up to 100GB of data storage and 300GB monthly bandwidth at no charge. To learn more and sign up for the waiting list, please visit our website.

We’ll be demoing the service at Google I/O in our session and the Developer Sandbox. We’re looking forward to meeting those of you who are attending.

by Jessie Jiang, Google Storage for Developers Team

Back in March, we launched the Google Apps Marketplace and turned Google Apps into a platform for your apps using Google’s Data APIs, OpenID-based identity management, and universal navigation. We also gave you a sneak preview of Gmail contextual gadgets, an extension mechanism that allows developers to intelligently trigger their application within Gmail. Gmail contextual gadgets bring your app directly into the inbox where users spend most of their day, giving your app powerful new functionality and enabling greater user engagement.

We are excited to announce that the Gmail contextual gadgets API is available to all Google Apps Marketplace developers today. You will be able to use our predefined email context extractors to contextually trigger your gadgets within Gmail. In the future, you will also be able to write custom context extractors; sign up here to take a peek.

The contextual gadgets that you write can be bundled into manifests and listed on the Apps Marketplace. Google Apps domain administrators can deploy your gadgets to their users with a few clicks. As with all new APIs, we will keep this one in Labs as we enhance these gadgets.

Several apps featuring Gmail contextual gadgets are launching on the Marketplace today, with more on the way. To check out their integrations and read our full announcement, visit our post on the Google Enterprise Blog. To get started with building these contextual gadgets, visit the developer's guide.



We are hard at work adding even more extension points to Google Apps to enable a richer integration experience for developers and a more seamless user experience for Google Apps customers. Stay tuned!



Update: Docs are now live!

You might be asking why we’re so excited. Here’s some of the reasons:
  • There are plenty of great sessions including a few that I’ll have the pleasure of speaking in.
  • Lots of awesome people are in town! This morning, we met with some great developers from Germany, and we’ll surely meet plenty more developers at I/O.
  • There’s a kid that needs a kite, and I’m lucky enough to have a Google branded kite to give him.
Looking forward to seeing all of you! The Marketplace team and the broader Google Apps team will be at Google I/O. You’ll find us in Office Hours, in the Sandbox and speaking in many sessions, including the Fireside Chat. Come find us in these official venues or at the lunches and parties and tell us about you and your company and what you’re doing with Google Apps.

Of course, most of you shouldn’t come just to see us (though we’d be flattered)-- you should come to see all the great work done by all the developers showcased in the Sandbox. These folks are SaaS vendors, resellers and systems integrations that are doing amazing work with Google Apps.

If you unfortunately were not able to make it to I/O, there’s still a few things you can do: watch the live streams of the keynotes and stock up on the popcorn for when we release all the session videos on YouTube shortly after I/O.

The Google Apps Marketplace launched last month with over 50 integrated business applications. In less than 2 months, more than 1 million Google Apps users now have access to integrated cloud apps that their organization’s IT administrators have installed through the Google Apps Marketplace. More businesses are adding their applications to the Marketplace every week. Google Apps are used by more than 25 million users at over 2 million businesses, and growing very fast.

The Google Apps Marketplace is growing, and we want your suggestions on how to make it bigger and better. Here is your chance to submit your big ideas and small suggestions on Google Apps Marketplace and the APIs used to create installable apps. You can also see existing ideas and what others have to say. Vote up the ideas you like the most. You tell us what's important.

We have set up two Product Ideas sites; one for improvements to the Marketplace itself, and another for applications you would like to see available for sale in the Marketplace. There are already lots of ideas and over 300 votes. Take a look at the ideas and add yours to the list.

Thank you from the Google Apps Marketplace team.