Using Google Geocoding API in Python

Started work on a wrapper for the Google Geocoding API, called pygeocoding. Check out the Github page for the code and usage.

The intent is to provide a Pythonistic interface in building your Google Maps such as building a Google Map in Django with locations stored in your models. As noted on the API page:

Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

Some example usage:

import pygeocoding

# Let's find CERN
pygeocoding.LookUp(address="CERN CH-1211 Genève 23 Switzerland")
{u'status': u'OK', u'results': [{u'geometry': {u'location_type': u'APPROXIMATE', # ... truncated output

# We can also search backwards - let's pipe in the lat/long of the liberty bell (approximately)
# - we'll just see what the first result is
r = pygeocoding.LookUp(latlng="39.9518819802915,-75.1476150197085")

# now we can pipe these results to our mapping functions

Google+ vs Facebook

I received a pretty early invite to Google+ a while back and I’ve been really buying into the revolutionary(?) social networking service wholeheartedly. I would be inclined to suggest dropping the term social here as I feel it is a mature platform more apt for productivity; not to sound pretentious, but the grown-ups’ Facebook. There is an overload of commentary on Google+ and how it compares to Facebook so I won’t really try to jump into the fray here. However, I did have a few thoughts tonight while playing around on both sites and will simply throw out a quick list of some things that came to mind.

Here is the link to the Google+ post.

Or here is the post content:

Google+ vs Facebook

Things I really like about Google+ over Facebook (in no particular order and not fully inclusive – more of an off the cuff list):

– MUCH easier to find people
– Circles are how it should always be with social networks/applications
– Cleaner and faster interface
– No zombie pirate mining farms
– Productivity and efficiency in mind
– Huddles and hangouts are really well done so far
– Keyboard shortcuts such as bold and italicized
– No spamming overlords (yet?)
– Real names (although I don’t agree with the harsh lockouts I guess)
– Google product integration is pretty slick
– The mobile app is light years beyond the facebook app (at least on ios)
And last but not least, the open source community is present and accounted for!

– Oh and apparently on Facebook this has to be a note since it’s longer than 400 (or so) characters… come on…. I can rant away on Google+

We’ll have to see how things pan out as more people adopt Google+ and development rolls along. At this point, I will admit that I was an early advocate and fan. After some solid use of all the features and side-by-side comparison of day to day posting and usage, I remain and advocate and fan.

See you on Google+! [me]

Installing Google Chrome in Slackware 13 (13.37)

Trying to install Google-Chrome via RPM (with rpm2tgz) will give you an error with libnss3. Don’t fret, there is already a way to build Google-Chrome without much effort. Below is a quick way using the mirror from Penn State (carroll), but if you have your install media, you can find the same files there in /extra.

Go to:

The README file is pretty self explanatory, but essentially you want to do the following:

  1. Become rootSetup a build directory (mkdir chrome && cd chrome)
  2. Wget these files: [ ] [ ] [ ] [ ]
  3. Change execution bit on slackbuild file and run it (chmod +x google-chrome.SlackBuild && ./google-chrome.SlackBuild)
  4. Go to tmp and install the file (cd /tmp && upgradepkg –install-new google-chrome.txz)
  5. Go back and install the other files (cd /root/chrome/ && upgradepkg –install-new *.txz)

Now you should have a fully functional google-chrome install.

Serving a Printer to Google Cloud Print from Linux

Been waiting for Google Cloud Print to finally come to linux?

The wait is over!

For now, Google has only released the ability to serve up a printer to the Google cloud via Windows while explicitly noting that the capability to do so in Linux is on the way. However, the entire ‘Cloud Aware’ printer scheme has seemed to always been referred to as coming-soon and that is probably a ways off yet. So I remain skeptical as to when we will actually see this ability. [update: There are some out there now and reviews are trickling in.]

Luckily, Armooo posted a python script that you can run on Linux (and I assume *BSD, but haven’t tested just yet) to serve up your local CUPS printer to the Google Cloud.

The script can be found here at his Github page and uses Python and PyCups to serve up your CUPS-enabled printer to the Google Cloud.

I have the HP Laserjet Pro P1102W printer served up locally via CUPS. It’s connected to the Linux desktop I am running the cloud print script from using USB and runs extremely well in Linux using the newest HPLIP. The printer is this one here: HP LaserJet Pro P1102w Printer (CE657A#BGJ); this printer will be discussed in another post about Linux printer setups.

Once your printer is setup and working locally and you have confirmed that CUPS is serving it up fine, you simply run Armooo’s script and it will serve up all of the found CUPS-based printers to the cloud. You can then print from any Google Print enabled device or the Chrome browser as discussed here.

~/bin/cloudprint$ ./
Google username: [email protected]
Password: yourpassword
Added Printer HP-LaserJet-Professional-P1102w

I then used my phone to go to the mobile Google Docs page and from there I could print out a document directly to the printer at home. Worked like a charm.