Posts tagged with Google

This is why Google Maps is so good

October 24th, 2009

Check out the blog post Google LatLong: Evolving the look of Google Maps and I’m sure you’ll agree that Google Maps is by far the most usable and aesthetically pleasing online mapping service out there.

Emerce eDay

August 20th, 2009

Just a quick note that I’ll be talking about Google Wave at the social media tools session at Emerce eDay on September 17 in Rotterdam.

oAuth on App Engine, Part 2

May 24th, 2009

In my previous post I described how to use Google’s federated login to get an oAuth access token. Now that we’ve stored our access token, we’re going to want to use it in future requests to access the user’s data. Here’s how:

# set up service
gdata_service = gdata.service.GDataService()
gdata.alt.appengine.run_on_appengine(gdata_service)
gdata_service.SetOAuthInputParameters(gdata.auth.OAuthSignatureMethod.HMAC_SHA1, settings.GOOGLE_CONSUMER_KEY, settings.GOOGLE_CONSUMER_SECRET)

# build access_token object and signed request
scopes = [settings.GOOGLE_ANALYTICS_ACCOUNT_URI, settings.GOOGLE_ANALYTICS_DATA_URI]
oauth_input_params = gdata.auth.OAuthInputParams(gdata.auth.OAuthSignatureMethod.HMAC_SHA1, settings.GOOGLE_CONSUMER_KEY, settings.GOOGLE_CONSUMER_SECRET)
access_token = gdata.auth.OAuthToken(scopes=scopes, oauth_input_params=oauth_input_params)
access_token.set_token_string(person.accessToken)
gdata_service.current_token = access_token

# request feed
feed = data_service.GetFeed(settings.GOOGLE_ANALYTICS_ACCOUNT_URI)

feed is a GDataFeed object which can easily be iterated over, like so:

for entry in feed.entry:
    print entry.title.text

To be honest, I’m not sure if the scopes are necessary but I included them for the sake of completeness. Setting oauth_input_params for the oAuth token is essential and something that took me a while to figure out – I had assumed that setting the parameters for the Gdata service would be enough.

I am directly assigning the access token to the Gdata service. I had originally tried to use the setter – gdata_service.SetOAuthToken(access_token) – but had problems and switched to direct assignment. However, my problem could very well have been somewhere else, so feel free to try using the method.

Finally, you may have noticed that I’m querying the Analytics Data API. I hope to have more to announce about that soon. In the meantime, I’ll note that gdata-python-client doesn’t have specific Analytics support, which is why I’m using the generic Gdata service.

OpenID and oAuth on App Engine

May 11th, 2009

Building on my previous post, here are some things I learned today while working to get OpenID and oAuth playing nicely with Django on App Engine.

While App Engine has a very nice login system that hooks seamlessly into Google Accounts, gaining access to the user’s data via one of the Gdata feeds requires an additional authorization (you would use oAuth of course). However, Google has also introduced a federated login method whereby you can send the user to one screen where they both login and approve your access via oAuth to their data. So, I gave up development speed in favor of something that is hopefully simpler for my users. If you want to know more, Joseph Smarr of Plaxo has a good writeup of how the hybrid OpenID + oAuth combination came about. Read more »

Installing the Google App Engine SDK and Django 1.0.2

May 6th, 2009

This was quite tricky for me, so I’m writing this down to share it with others.

  1. Install the SDK

    Simply download the SDK and install it. On Mac OS X that meant that I mounted the disk image, dragged the SDK app to my applications directory, and launched it. Make sure to give the app the necessary permission to create symlinks.

  2. Get the latest version of google-app-engine-django

    Use SVN to export the latest version of google-app-engine-django: svn export http://google-app-engine-django.googlecode.com/svn/trunk/ your-app-dir

  3. Get the latest stable version of Django

    Download from http://www.djangoproject.com/download/. Decompress it.

  4. Zip up Django

    Google Apps currently uses version 0.96 of Django and they do not plan to switch in the near future. Thus, you need to put a django.zip file in your App Engine app directory, your-app-dir. You create the file by, from the Terminal, going to the directory of the new version of Django you downloaded and typing:

    1. zip -r django.zip django/__init__.py django/bin django/core django/db django/dispatch django/forms django/http django/middleware django/shortcuts django/template django/templatetags django/test django/utils django/views
    2. zip -r django.zip django/conf -x 'django/conf/locale/*'
    3. zip -r django.zip django/contrib/__init__.py django/contrib/formtools django/contrib/auth django/contrib/sessions

      Note there is an oversight in the App Engine article about zipping Django 1.0; the last two directories are necessary.

  5. Edit settings

    Open app.yaml in your App Engine app directory and change the application name on line 1 to the name of your application. Then, open settings.py and uncomment line 83 so that django.contrib.sessions.middleware.SessionMiddleware is included.

  6. Launch the default app

    From your App Engine app directory, launch the server: python manage.py runserver. If everything went correctly you should see the server mention using zipimporter and then announce that your app is running at http://localhost:8000. Open the URL and your should see a simple welcome message.

  7. Build your app!

    Now you can get started building a Django app on App Engine. Make sure to read the article on using the Django App Engine helper to see how to start building your app.

Conference Season

April 9th, 2009

Or, should I spend a month in Silicon Valley soon?

May 19-21 is Where 2.0

May 27-28 is Google I/O

June 8-12 is WWDC

All nice events and ones that are relevant to the work I’m doing but not cheap… Will you be at any of these conferences?

HTML5

April 8th, 2009

Google says it very succinctly: “HTML5 and WebKit pave the way for mobile web applications.” HTML5 is coming and it has a lot of interesting features, from audio and video support to local storage. Combine this with the fact that web apps are a particularly attractive way to reach many mobile platforms and the WebKit browser found on the iPhone and Android platforms already implements many of the HTML5 standard, and you can see why HTML5 is so attractive for mobile apps.

With the ability of HTML5 web apps to store data locally and have the browser pass along the device’s hardware states, I believe that HTML5 wbe apps can do almost anything you could want an internet-using application to do. The only exception I can think of is high performance 3D graphics, as even great 2D graphics are possible with CSS3 and HTML5′s canvas tag. Already there are nice libraries like RaphaëlJS that work in the iPhone’s Mobile Safari.

Google versus Yahoo

November 27th, 2008

It’s pretty obvious who’s winning the battle for user attention. I really love Yahoo services such as Upcoming and Flickr but you can’t lose site of the fact that most of them are niche services.

Google vs Yahoo

Google vs Yahoo

Maps of Human Tragedies

November 20th, 2008

For some reason I have run across a lot of Google Maps mashups in the last 24 hours ago dealing with the less happy side of life. In fact, they (almost) all show recent or event real time events. Some examples:

Not in real time but along the same lines (and admittedly quite controversial), there have been several maps made of membership in the far-right BNP in the UK in the last day as the party’s membership list was leaked online.

On a lighter note, the US Office of National Drug Control Policy made a map of medical marijuana dispensories and Starbucks cafés in San Francisco, eliciting predictable responses.

As you can see, a website mapping important events or locations can be a very powerful way to make a political or business point.