Deploy a Web Twitter client to Google App Engine
OAuth provides a better way for consumers to access protected resources at the service provider's site. By using OAuth, user credentials will never be exposed to sites other than where the user data was originally saved. By using the desktop Twitter client developed in part 1th, you can update your twitter status after authorizing myttdesktopclient access to your Twitter data. For the returned user, this is a good user experience because Access tokens can be reused. Part 2nd shows how to use OAuth to develop a WEB Twitter client that enables users to authenticate to Twitter and update their status through OAuth. It also shows the timetable of our friends.
In this article, you will learn how to make your WEB application work in a production environment. You will migrate the Twitter clients developed in part 2nd to the Google App Engine (GAE). You cannot simply deploy the WAR file; you need to make some modifications to make it work under GAE. The easiest way to handle gae is to use Google Plugin for Eclipse, which supports Gae and Google Web Toolkit (GWT) development.
Google App Engine
GAE is provided by Google to enable Web applications to run on Google's infrastructure. One of the big advantages of GAE is that your application can easily expand as traffic and data storage requirements grow. You can focus on software development without having to worry about Web and database server maintenance. When you deploy to the application on GAE, you can use it for free when the traffic is moderate. When more and more users are attracted to your site, you can buy more CPU time and data storage from Google. At the time of writing this article, GAE can support both Python and Java™ code.
Sign up for your WEB application on Google
All GAE applications need to be registered on Google.
If there is no Google account, then please register one.
Visit Google App Engine and log in.
Click Create an application. You will be prompted to enter the country and mobile phone number.
Google will send a CAPTCHA to your phone.
Once authenticated, you can log on to GAE and click Create an application to create a WEB application.
For example, I provided the following information when I registered my application:
Application identifier:dr-yang-tt.appspot.com
Select your own unique identifier.
Application Title:dr Yang ' s Twitter Client
Authentication options: Click the Edit link, select restricted to the following Google Apps domain, and then leave the dialog box blank.
By default, sites are exposed to all Google account users, but these settings enable everyone to access your site (users with Google accounts and non-Google users).
Sign up for your WEB application on Twitter
If you've read the first two articles in this series, you can register for a new application or modify a registered application in Twitter. As shown below, the sample application is registered as a new application, located in Http://twitter.com/oauth_clients.
Application Name:dr Yang ' Tt Web Client
Description: A Twitter Web client running inside the Google application engine
Application Web site:http://dr-yang-tt.appspot.com/twitterwebclient
Application Type:browser
Callback url:http://dr-yang-tt.appspot.com/twitterwebclient