Automating external data import with Excel (2)

As i wrote earlier on my blog (and twitter) i would get back to this subject.

The task is quite simple. You have a Microsoft Excel sheet with a list of visits you did in a year. You did register each customer, and it’s zipcode, and complete address. Now your boss (or his secretary) asks you to deliver a sheet with kilometers travelled for your visits.

One can take a whole day (or more) to look them up with Google Maps, or you can use the data that you already have and automate this process with the Google Api’s. Continue reading

Solving OAuth problems on my blog

Since yesterday it seemed that there occured some errors. Most likely when you tried to login or post a comment. This was due to the OAuth library included with several plugins and all tried to declare the same classes and functions. For now this is solved by adding a class_exist check in the library.

I will lookup the OAuth project and check how we can incorporate these suggestions in to the library.

Old:

class OAuthConsumer {
	public $key;
	public $secret;

	function __construct($key, $secret) {
		$this->key = $key;
		$this->secret = $secret;
	}

	function __toString() {
		return "OAuthConsumer[key=$this->key,secret=$this->secret]";
	}
}

New:

if (!class_exists("OAuthConsumer", false)) {
	class OAuthConsumer {
		public $key;
		public $secret;

		function __construct($key, $secret) {
			$this->key = $key;
			$this->secret = $secret;
		}

		function __toString() {
			return "OAuthConsumer[key=$this->key,secret=$this->secret]";
		}
	}
}

Note lines 1 and 15.