Google Goggles for Android

Posted on Thursday, April 22nd, 2010 under , , ,

Impressive. Android will prove a valuable competitor for the iPhone.

Import emails for Evolution in Gmail

Posted on Wednesday, April 14th, 2010 under , ,

Google Apps logoSeveral days ago, I decided to start using Google Apps for my email. I’m not a Google fanboy, but in some areas they’re the best. And Gmail is one of those areas. To have virtually unlimited storage space and access to your emails is *very* important. And I also love the way Google groups emails into conversations. The process was painless, just some minor DNS modifications, filling some forms on Google’s site and that’s it.

A problem arose when I wanted to import my existing emails from Evolution to Gmail. Although Google provides extensive documentation and even a migration API, I was unable to find something tailored for Evolution. After some Googling and asking around, I decided to use the – kind of lame, but nevertheless, effective – IMAP approach.



It’s quite simple:

  • enable IMAP support in your Gmail CP
  • add the newly created IMAP account to your Evolution
  • in Evolution, copy all the emails from your regular account to your Gmail one
  • wait for the IMAP account to synchronize with the server (it might take a while, depending on the number of emails/attachments)

All your current folders will be imported as labels in Gmail. For some unknown reason, it was unable to group all conversations, although I uploaded the “Sent” folder. Anyways, if you have a better idea, feel free to post a comment.

Gworld

Posted on Thursday, December 17th, 2009 under ,

google Is Google taking over the web? It seems so. Lately Google launched its own services to compete with other companies / open source associations on all fronts – DNS, source code hosting, url shortening, instant messaging, email. You name it and Google has it. Of course, not all Google’s services are top of the line in their field, but, if you look at it as a whole, Google is slowly taking over the word.

I’ve compiled a list with all the stuff I usually do online, presented Google’s service and the service I’m using:

Action Google’s offer I use
browse the web Chrome Firefox
search for the information you want Google Google
Upload / store images Picasa Facebook / Flickr
“url shortening” service goo.gl re.pl.ly
blog Blogger Wordpress on private server
read email Gmail / Wave private mail server
chat with friends Gtalk Yahoo! Messenger / Skype
search for places on the map Google Maps Yahoo! Maps
watch online videos YouTube YouTube
DNS service Google Dns OpenDNS
cloud computing Google App Engine none – I didn’t need that kind of power so far, but Google’s alternative is great)
source code hosting/versioning Google Code github
hosting services for popular js frameworks (jQuery, etc.) Google Code local deployment / Google Code (scarcely)
document sharing/collaborating Google Docs Google Docs / private Wiki
groups / mailing lists Google Groups none
translation services Google Translate Google Translate

As it turns out, I’m not addicted to Google! I use some of Google’s services, but the only one I couldn’t live without is the search engine. But my question is what will happen when/if Google will control most of the services on the web? I mean when 90% of the users will use Google’s alternatives, will Google become the new Microsoft? Or they will keep to their “don’t be evil” creed?

What Google services do you use and what are the alternatives?

Better PHP exchange rate script

Posted on Monday, September 28th, 2009 under ,

Long, long time ago, in a galaxy far, far away :) I was searching for a way to get the exchange rate automatically and use it in a project I was working on back then. And, following the will of the Force, I’ve came up with this script, which queries Google for the exchange rate and parses the answer page with regular expressions.

The script has proven useful to a lot of people, but, several days ago, an user called Lars Sorhus posted a comment in which he posted a link to another Google service, that outputs a (malformed) JSON containing the exchange rate.

The JSON based solution is much more elegant than parsing a HTML file with regular expressions, so I went for it, but since Google’s conversion service doesn’t output well formatted json, PHP’s built-in json_decode() function won’t work, so I had to look for another parser.

I’ve settled for PEAR’s Services_JSON class for decoding the JSON, as the test said that it can parse almost anything. And it does. Here’s is an working example:

/**
 * queries Google for the current exchange rate, doesn't need cURL
 * 
 * @param mixed  $amount
 * @param string $currency
 * @param string $exchangeIn
 * @throws Exception
 * @return mixed
 */
function exchangeRate($amount, $currency, $exchangeIn) {
    $url = @ 'http://www.google.com/ig/calculator?hl=en&q=' . urlEncode($amount . $currency . '=?' . $exchangeIn);
    $data = @ file_get_contents($url);
 
    if(!$data) {
        throw new Exception('Could not connect');
    }
 
    $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
 
    $array = $json->decode($data);
 
    if(!$array) {
        throw new Exception('Could not parse the JSON');
    }
 
    if($array['error']) {
        throw new Exception('Google reported an error: ' . $array['error']);
    }
 
    return (float) $array['rhs'];
}

It uses exception, because I think that the OOP exceptions based approach is much better than return false or adding a passed by reference parameter to be used for error signaling. It’s very simple to use:

try {
	$rate = exchangeRate(1, 'euro', 'usd');
	echo 'Exchange rate is: ' . $rate;
}
catch(Exception $exception) {
	// log $exception->getMessage()
	echo 'Due to technical difficulties, we couldn\'t get the exchange rate';
}

Of course, you must include the Services_JSON.php class from the PEAR repository prior to calling exchangeRate().

Google tech talks on API

Posted on Wednesday, August 19th, 2009 under ,

Google Tech Talks are Google’s answer to TED Talks but, as expected, with much more focus on technology. And they show some very interesting stuff, like the following talk on how to design an API. If you have a free hour, watch it.

Via Alex Novac.

Google Chrome

Posted on Tuesday, August 11th, 2009 under ,

Google Chrome Logo It’s been almost an year now since Google Chrome was launched.

Like all things Google it focuses on simplicity and ease of use and a lot of people adopted it for these features and now Chrome has a market-share somewhere between 4 and 7 percent of all Internet users (depending on the source).

Now people are starting to ask when will the Linux version be launched and expressing willingness to use Google’s browser on their Linux platforms, thus boosting Chrome’s percentage up.

But, before rushing off and installing Chrome, think about what you are really doing: you’re building the prerequisites for another browser war. Chrome isn’t all compatible with Firefox or other open source browsers, and, while Google might seem like a benevolent and trustworthy company now, I’m sure it will turn to be just another Microsoft in the near future. Remember that Google collaborated with the communist government of the People’s Republic of China in order to impose censorship on the Chinese people denying some of those people’s most basic human rights. Don’t be evil…Right!

I’m sure that Sergey Brin and Larry Page started Google in good faith, but the company doesn’t belong to them any more. It belongs to the shareholders. And if these shareholders will consider that starting another browser war would benefit them, they will do it. There’s no doubt about it. Don’t help them. Think about all the headaches we’re still having with Internet Explorer. Use an open source independent browser. Use Firefox.

Google Wave

Posted on Wednesday, July 1st, 2009 under ,

Bookmark this page for when you have a free hour. It’s worthed!

I can’t wait to see it on the market. More details on wave.google.com.

Google and link rel=”canonical”

Posted on Monday, February 16th, 2009 under ,

News from Google. The search engine will allow us to specify more URLs for the same content (example – same article filed under more categories that gets displayed on every category’s page).
Just insert…

<link rel="canonical" href="{original_url}" />

…on all other pages that have the same content. This does not work across domains.
Read more on the subject on Google’s Webmaster Central Blog.

Google Maps vs Yahoo Maps

Posted on Tuesday, January 27th, 2009 under , , ,

Today I had to choose between Google’s and Yahoo’s Maps APIs. As I’m quite a Google fan, I first checked out its maps API. Very disappointing. It seems that the API was designed by some marketing guy or a janitor. I know, tough accusation. And I haven’t even code one page with Google’s API. What makes me say that? Well, it all ended when I started reading their Terms and Conditions. It seems that all Google Maps API key are domain dependent (only work for a specified domain). And this sucks.

There are 4 traditional stages in software development: development, integration, staging and production. Usually, all these stages take place of different machines that have different domains and/or subdomains. This means that you need a Google API key for each stage. It means that you’ll need at least 3 different API keys just to get to the part where you’re testing the application. But if the developers use different virtual hosts for the project, the number of required APIs increase exponentially. I know that API keys are free, but time isn’t and it’s quite annoying to have to register for a new API key everytime you set up a demo version of the project on a new subdomain.

With Yahoo on the other hand, you only need one API key. And it works. A word of advice: if you need a map API, go with Yahoo! I did…

Currency conversion in PHP

Posted on Friday, December 19th, 2008 under , ,

I was looking for a way to include a currency converter in a website. Not wanting to reinvent the wheel, I googled around for a PHP currency conversion tool, but I didn’t find anything suitable. They were bloated, filled with annoying copyright notices with lots of logos or you had to include a file from their server. In other words, only crap. I needed something simple. You know…get in, score, get out. Keep reading»