All posts tagged API

Yahoo Term Extractor API Discontinued

A couple of days ago Yahoo announced two of its search services will be discontinued on August 31st 2009.

Annoyingly, one of those is the Term Extraction API
Which means my Windows Live Writer Auto Tag Generator plug-in will simply cease to work.

Important Announcement: The Term Extraction Web Search service will be discontinued on August 31, 2

So, what can you do.

Well, according to a few posts on twitter, Zemanta seems like a suitable replacement.

I’ll check this out, and write up a post on it soon, in the mean time, there’s an introduction here.

Reverse GeoCoding with Google API and C#

I needed to write a function to get a set of co-ordinates from an address, supplied as a string.
Using the Google API, I came up with this:

First, I created a struct, to represent the lat and lon co-ordinates:

public struct Coordinate
{
	private double _latitude;
	private double _longitude;

	public Coordinate(double latitude, double longitude)
	{
		_latitude = latitude;
		_longitude = longitude;
	}

	public double Latitude { get { return _latitude; } set { _latitude = value; } }
	public double Longitude { get { return _longitude; } set { _longitude = value; } }
}

This is a simple representation of a set of latitude and longitude co-ordinates.

The main method, which returns the above Coordinate struct is:

public static Coordinate GetCoordinates(string address)
{
	using (var client = new WebClient())
	{
		Uri uri = YOUR_URI_HERE;

		/* The first number is the status code,
		* the second is the accuracy,
		* the third is the latitude,
		* the fourth one is the longitude.
		*/
		string[] geocodeInfo = client.DownloadString(uri)		.Split(',');

		return new Coordinate(
			Convert.ToDouble(geocodeInfo[2]),
			Convert.ToDouble(geocodeInfo[3]));
	}
}

On line 5, you need to specify your Google API URL, in the format of:

http://maps.google.com/maps/geo?q=ADDRESS GOES HERE&output=csv&key=YOUR KEY HERE

And that’s it!

Obviously, there are usage restrictions when using the Google API for this, as outlined on the documentation pages

TinyURL API

The popular url shortening service, TinyUrl has an API.

This is probably the most simple API I’ve come across:

http://tinyurl.com/api-create.php?url=http://www.alexjamesbrown.com

(obviously, you can replace http://www.alexjamesbrown.com with any URL)

Freelancers.net RSS Feed

I use Freelancers.net to scout out potential freelance clients, however logging on to the site every couple of days is somewhat tedious. Much better would be to have an RSS feed to subscribe to?

Unfortunately Freelancers.net doesn’t provide one!

Not to worry, using Dapper, i have created one.
The URL for the feed is below:

http://www.dapper.net/services/freelancers

Happy freelancing.