Syncing Google Contacts with iMessage (and Contacts) on OSX Mavericks

You may remember earlier in the year I took issue with the super secret hidden checkbox in the Mountain Lion’s version of Contacts which magically syncs your Google contacts with OSX Contacts and Messages. As it seems, Apple have finally fixed the SSL problem stopping you from syncing through the Google option in System Preference’s Internet Accounts setup.

Getting the sync to work now is as trivial as adding a Google account to your Internet Accounts list, log in and turn on the items you want to sync. Screen Shot 2013-11-26 at 9.46.42 pmHurray! Easy peasy.

It’s beyond me that it wasn’t like this before.

 

Syncing Google Contacts with iMessage (and Contacts) on OSX Mountain Lion

Being able to sync your Google Contacts with your OSX Contacts is possible – it just takes a bit of digging.

As a long-time iPhone 4 user, I was recently introduced to the wonderful OSX Messages app, which lets me read/send iMessages from my Mac, as if I had sent a text from my phone. Such an amazing thing (even if it does only work with other iPhone users). However, it only used phone numbers to identify contacts; less than ideal since I seldom reference my friends and family by their cell numbers.

I use Gmail for all my email purposes; and after loosing my completely contacts list TWICE from the failures of Windows Mobile 6, I am also a huge advocate for Google Contacts – awesome synergy between my phone list and email contacts. and while I’ve been very happy Syncing my email/calendar/contacts between Google and my iPhone; my Mac just didn’t want to come to the party and I refused to retype my contacts manually.

At first I tried syncing the contacts over Google’s Microsoft Exchange Protocol (which is actually the best way of syncing Gmail/contacts/etc onto the iPhone), however you cannot get the necessary SSL to connect to Google on Mountain Lion. Next I tried backing up my iPhone contacts into iCloud, which also failed.

I was about to give up until I discovered that the preferences for the Contacts app has an option that I didn’t know about. Carefully disguised under the “On My Mac” account, you will find the option to sync with Google.

syncing-google-contacts-in-mountain-lionHurray! Easy Peasy.

Ruby Script to Import Google Contact Photos From Gravatar

Google Contact photos are a much neglected feature of the Google Stack. It really adds to the user experience when you see each of your contact photos when you make or receive a call. However, it can be a real pain (especially if you have hundreds of contacts).

But I had an idea recently, to try and match my Google Contact emails with Gravatar and try to auto-populate some of the dozens of contacts that didn’t already have a photo (after all a Gravatar is better than nothing).

So I wrote a Ruby script to find my contacts missing a photo and try to update it with a Gravatar (wherever possible). NB: You may need to first install the GData (Google Data) gem by opening a Terminal window and issuing: sudo gem install gdata.

#!/usr/bin/env ruby

# Google Contact Photos - Gravatar Importer
# Written by Ashley Angell
# http://ashleyangell.com
# Licenced under Creative Commons with Attribution

require "rubygems"
require "gdata"
require "rexml/document"
require "digest/md5"
require "net/http"
include REXML

none = 'd5fe5cbcc31cff5f8ac010db72eb000c'
user = ARGV[0]
pass = ARGV[1]

client = GData::Client::Contacts.new
client.clientlogin(user, pass)
data = client.get("https://www.google.com/m8/feeds/contacts/#{user}/full?max-results=10000")
myxml = Document.new data.body
p "contacts"
puts "-"*70
i = 0
myxml.each_element("feed/entry") do |e|
  begin
    gd = e.elements['gd:email']
    if !gd.nil?
      email = gd.attributes['address'].downcase
      hash = Digest::MD5.hexdigest(email)
      image_src = "http://www.gravatar.com/avatar/#{hash}"
      nil_image = false
      image_element = e.get_elements("link[@rel='http://schemas.google.com/contacts/2008/rel#photo']")[0]
      if !image_element.nil? and image_element.attributes['gd:etag'].nil?
        data = nil
        md5 = nil
        Net::HTTP.start(URI.parse(image_src).host) do |http|
          resp = http.get(URI.parse(image_src).path)
          data = resp.body
          md5 = Digest::MD5.hexdigest(data)
          File.open("#{email}.png", 'w') do |f|
            f.puts data if md5 != none
          end
        end
        md5 = Digest::MD5.hexdigest(data)
        if md5 != none
          puts "#{email} > #{image_src}"
          client.put_file(image_element.attributes['href'], "#{email}.png", 'image/png')
          i = i + 1
        else
          puts "#{email} > no match"
        end
      else
        puts "#{email} > skipped (already has photo)"
      end
      File.delete("#{email}.png") if File.exists?("#{email}.png")
    end
  rescue Exception => ex
    puts ex
  end
end
puts "Updated #{i} contact photos"

To execute it, simply copy and paste this into a text editor (or download it and unzip) and from Terminal (command) window and execute the following commands:

sudo chmod +x googlegravatarimporter.rb [Enter]
./googlegravatarer.rb your.address@gmail.com your_password [Enter]

It will cycle through your Google Contacts and indicate what action was taken. For me, surprisingly updated a few dozen contacts (even more than I expected).

I’ve posted this here for others that might want to do the same thing but cannot be bothered writing the script for it. Consider it posted here under Creative Commons with Attribution.

HTC Math Fail

Can you spot the problem? This isn’t exactly an epic fail, nor is it particularly or devastatingly terrible, but I do think that mobile devices do need to work properly, and clearly this is a bug. This is a HTC Desire, but the same bug is replicable on the HTC Desire HD. While this isn’t a reason not to buy an android phone, I choose to use it as an example to make myself feel better about living inside the Apple Reality Distortion field. Sure, the iPhone might be communist, but the streets are clean and the trains run on time.

UPDATE
It turns out that this is a bug with the HTC Basic Calculator, and not a bug with the device itself (as verified by testing the same math on another calculator app on the same phone) but it’s still as funny as hell.

How to Export an Entire Newsfeed From Google Reader

Google reader is an amazing web-based feed reading application.  One of it’s most outstanding features is the ability to archive feeds, and show you posts from the feed regardless of when you subscribe.  You see, normally, RSS and ATOM feeds only contain the 10-30 of the most recently posted items, but since Google Reader stores all the posts from the subscribed feeds, they’re (usually) all available if you keep scrolling down in the interface.

This makes it an awesome feed caching and archival tool.  However, not many people are aware that you can actually extract the data back out, in one mega standard ATOM file.

Just enter this URL in the address bar:

http://www.google.com/reader/atom/feed/FEED_URL?r=n&n=NUMBER_OF_ITEMS

…where FEED_URL is the address of the feed and NUMBER_OF_ITEMS the number of posts to extract.

For example, http://www.google.com/reader/atom/feed/http://feeds.feedburner.com/blogspot/MKuf?r=n&n=100 should return the latest 100 posts from the Official Google Blog as an ATOM/XML file.

I’ve finally found a great use for Google Wave that DOESN’T require all your friends to be on it.

It’s this, a to-do list!

Ash-Google-Wave

It has been a great tool to synchronize the day-to-day activities of the family.  @MrsAngell and I have been using it to help manage the kids, and the household and the general stuffs needed, in preparation for Christmas, for example. Traditionally, we’d use IM clients such as Skype to communicate messages and synchronize our activities, using Outlook and Google Calendar only when absolutely necessary.

But for some reason, despite being massive email users, we very seldom email each other.  But the problem with this is that its difficult to read history and if we don’t have access to our computers – we cant read our histories and re-read what was discussed.  We made it work, but it had its problems.

Even though Wave is so much more capable than this very small and isolated use-case, I have to admit, it does do this very very well.

Since the only people who need to collaborate on this topic is myself and my lovely wife, the collaboration “issues” people have been complaining about with Google Wave doesn’t really apply. If you’re not familiar with what I am talking about, check this out:

zVn91

In either case, we’ve been using Wave to manage our daily lives and to make notes and comments to each other about various needs of the household and the family – and so far, it’s working just great.

It might seem weird to other people that my wife and I even need a tool like this, but as an organizationally challenged individual like myself, I find it’s making life just that little bit easier.

Card Counting

From the Official Google Blog, comes this little gem:

Late one night in the summer of 2000, I found myself answering user support emails in response to two new features we had just released, Advanced Search and Preferences (at the time catchily called “Language, Display, and Filtering Options” :)). Busy crafting answers about how to set Safesearch or change the number of results offered by default, I worked my way through the email queue. And then I saw it: The next email had just a number (“37”) in the subject – and no message text. What a weird form of spam, I thought. Why would anyone be motivated to just send a number? I searched for the user’s email address to see what else had been sent. Interesting. Lots of numbers: 33, 53, and then a clue: “61, getting a bit heavy, aren’t we?” Furthermore, the date on each of the messages seemed very familiar. Then I realized that’s because the dates were all days that I had launched various changes on the homepage. “Getting a bit heavy?” – that one did correspond to one of the wordiest homepage releases we had ever done. Could the sender be counting words? Sure enough, I looked back, counted the words myself, and he was – a manual, human version of a scale for the Google homepage. He was weighing our homepage and letting us know when it was getting too heavy. One of his earliest mails had a note in the body: “What happened to the days of 13?” – referring to the word count on the initial 1999 homepage.

This mystery and its revelation was really interesting because I thought about the homepage, and how to keep it simple, all the time. Yet I hadn’t thought to look at it through this very simple lens: just count the words. The fewer, the better. Ever since that night, this has been our discipline, and everyone who works on the homepage and its design knows the current number: 28. (That’s the word count for the basic page if you are signed out, there’s no promotional line running beneath the search box, you’ve set Google as your homepage and thus don’t get the “Make Google Your Homepage!” link, and you count “©2008 Google” as two words.)

So, today we’re making a homepage change by adding a link to our privacy overview and policies. Google values our users’ privacy first and foremost. Trust is the basis of everything we do, so we want you to be familiar and comfortable with the integrity and care we give your personal data. We added this link both to our homepage and to our results page to make it easier for you to find information about our privacy principles. The new “Privacy” link goes to our Privacy Center, which was revamped earlier this year to be more straightforward and approachable, with videos and a non-legalese overview to make sure you understand in basic terms what Google does, does not, will, and won’t, do in regard to your personal information.

How does privacy relate to homepage word count? Larry and Sergey told me we could only add this to the homepage if we took a word away – keeping the “weight” of the homepage unchanged at 28. Given that the new Privacy link fit best with legal disclaimers on the page, I looked to the copyright line. There, we dropped the word “Google” (realizing it was implied, obviously) and added the new privacy link alongside it.

hehe…nuff said!

YouTube Gets Backhanded By Viacom

In the ongoing copyright litigation between Google and Viacom, a judge on the United States District Court for the Southern District of New York has ordered Google (PDF) to hand over data on every YouTube user, including username, the associated IP address, and a list of all the the videos that user ever watched.

In this lawsuit, Viacom is seeking more than $1 billion in damages because of alleged copyright violations on YouTube.

(Source: ReadWriteWeb, Frederic Lardinois, July 3, 2008 9:53 AM)

This is truly shocking. England’s Statute of Anne (1710) is widely regarded as the first copyright law. The statute’s full title was “An Act for the Encouragement of Learning, by vesting the Copies of Printed Books in the Authors or purchasers of such Copies, during the Times therein mentioned.” This statute first accorded exclusive rights to authors (i.e., creators) rather than publishers, and it included protections for consumers of printed work ensuring that publishers could not control their use after sale. It also limited the duration of such exclusive rights to 28 years.

You see, the point is that copyright laws have been bastardized and twisted so much, that instead of protecting the creators of works, they exist (almost solely) to protect the investment of publishers. In fact in many developed nations in the world (most notably the UK and US) lobby groups are pressuring the governments to increase the current cap on copyright from 50 – to 100+ years!

I think that while it’s important for companies to protect their Intellectual Property, copyright is becoming more and more difficult to define; and more importantly, in an age where the barrier to produce new and creative works is so low – the original needs of “copyright” to protect creators is almost needless.

Like many things, I turn to the internet.  It gives me great comfort to know that people can protect and define copyright themselves with a simple little license.txt file outlining the wishes of the author., and I think we have the Open Source community to thank for this.  Creative Commons, under which nearly every blog operates, is an example of this.

But, as far as Viacom lawsuit is concerned – when any company violates the privacy and rights of users, it really pisses me off. What will be next? Google for indexing CNN.com? No I don’t think so, and I think we all know why!

The Bigger the Company, The More We Expect

Cross-posted from the Particls blog.

3 severe security vulnerabilities in 3 weeks, is not good for any software company these days. But when you’re a company held with much higher standards and expectations (at your own request), its far far worse.

Haochi uncovered another XSS vulnerability that easily and without the victims consent can steal cookies and hijack your Google account. Just like the others, victim’s need only visit a hosted site by a malicious attacker. I can only imagine the panic at Google as they try to put out these spot fires.

Blogger Garett Rogers, highly recommends “making sure you are completely logged out of your Google account while browsing the internet, until we have an official statement from Google stating their security team has thoroughly reviewed every Google property for these types of vulnerabilities”. This seems a bit alarming, but maybe it’s better to be safe then sorry.

That being said, no-one suggests staying logged out of Windows until Microsoft fixes the bugs.

Well, maybe if they were black, white and feathered they might.
… or if they often felt compelled to put an “i” at the start of their surname.