Archive for February, 2010

How to Retrieve a Zipcode Using JavaScript

Posted in JSON, JavaScript on February 25th, 2010 by Navarr – View Comments
// Retrieve user’s Zipcode
// Demo at http://sandbox.gtaero.net/zipcode.html
function retrieve_zip(callback)
{
	try { if(!google) { google = 0; } } catch(err) { google = 0; } // Stupid Exceptions
	if(navigator.geolocation) // FireFox/HTML5 GeoLocation
	{
		navigator.geolocation.getCurrentPosition(function(position)
		{
			zip_from_latlng(position.coords.latitude,position.coords.longitude,callback);
		});
	}
	else if(google && google.gears) // Google Gears GeoLocation
	{
		var geloc = google.gears.factory.create('beta.geolocation');
		geloc.getPermission();
		geloc.getCurrentPosition(function(position)
		{
			zip_from_latlng(position.latitude,position.longitude,callback);
		},function(err){});
	}
}
function zip_from_latlng(latitude,longitude,callback)
{
	// Setup the Script using Geonames.org's WebService
		var script = document.createElement("script");
		script.src = "http://ws.geonames.org/findNearbyPostalCodesJSON?lat=" + latitude + "&lng=" + longitude + "&callback=" + callback;
	// Run the Script
		document.getElementsByTagName("head")[0].appendChild(script);
}
function example_callback(json)
{
	// Now we have the data!  If you want to just assume it's the 'closest' zipcode, we have that below:
	zip = json.postalCodes[0].postalCode;
	country = json.postalCodes[0].countryCode;
	state = json.postalCodes[0].adminName1;
	county = json.postalCodes[0].adminName2;
	place = json.postalCodes[0].placeName;
	alert(zip);
}
retrieve_zip("example_callback"); // Alert the User's Zipcode

simpleTAPI is Broken

Posted in simpleTAPI on February 20th, 2010 by Navarr – View Comments

Apparently I’ve completely broken simpleTAPI somewhere between Build 27 and Build 30.  I thought I had fixed it with Build 29, but it seems that I was mistaken.

In lieu of this, I am putting simpleTAPI on a temporary hiatus.  I will be re-constructing it from scratch (though, probably looking back and using a good bit of the original code).  The next version should have several configurable options, and will hopefully interact with the Twitter API much better than the previous versions.

Build 30 was supposed to return results as an array([“TAPI”] => data, [“result”] => data).  But all I’m getting from it at the moment is “Unable to Authenticate User.”

Those wanting to use simpleTAPI should use Build 27, though you will have to deal with some minor quirks in the way results are returned.  (the TAPI array is simply appended to the results array, making things slightly complicated if you don’t unset($result[“TAPI”]);

What will be simpleTAPI 0.4 should have better error handling, better return data, and better built-in caching.  I’m also hoping to build in support for xAuth and Delegated OAuth, if at all possible.  (Though probably not since simpleTAPI is built upon another OAuth library).

So, I’m asking for any and all feature requests.  Is there something about simpleTAPI you don’t like or want to be improved?  Please, post in the comments below!

Y’all Don’t Love Me, Do Ya?

Posted in 子猫ちゃん GV OMS on February 18th, 2010 by Navarr – View Comments

Remember way back in November when I created something so ridiculously awesome I had to learn two whole new web technologies to do it?

If you don’t, or if you just picked up on my blog, that very incredibly awesome something was called Google Voice OMS – It allows you to send text messages through Outlook using your Google Voice account, without having to pay a third party company per-message.  Essentially making this very awesome feature in Outlook 2007 and Outlook 2010 FREE.

At first, I didn’t want to Open Source it.  I wanted to keep it for awhile and sell it to Google or something if it caught on – but there seemed to be so tiny of a reaction to the post that I published it on Github.  Do you guys seriously not like it?  I asked for SSL Hosting or Donations three months ago and I haven’t received a single cent to pay for the cost (nor an offer to host).

Not that there was really anything left to add to it, but I’ve pretty much just let the project die.  Nobody’s approached me about funding it, or providing hosting for it, and definitely not Google although it would be the best thing in the world to kick-start Google Voice for Businesses.

And I was even thinking of doing something cool like seeing if I could create a twitter client replica of it.  But you know what?  Never Mind.

How “Windows Phone 7 Series” Makes Sense

Posted in Windows Phone 7 Series on February 16th, 2010 by Navarr – View Comments

I’m sure every single person in the tech world can agree that Windows Phone 7 Series is a stupid name for a product, almost as bad as iPad.

However, if we take a step back and re-think about this incredulously long name and what it means exactly, you’ll see it may not be as entirely stupid as it was at first glance.

Windows Phone 7 Series describes the combined devices that will be running this new Operating System.  Just like the older OS devices will be called Windows Phone Classic Series.  “Series” is simply an added word to describe the devices together.

Therefore, in truth, Windows Phone 7 is the name of the OS itself, which is a lot less stupid than Windows Phone 7 Series.

I’m still wondering if there is a specific way they could make the name for the series itself more appealing.

My Problem with ID3 Taggers

Posted in Software on February 15th, 2010 by Navarr – View Comments

I have yet to find one that will automatically tag my vast library of music that isn’t English.

I love animé, and until about my third girlfriend I didn’t have much or any music on my computer, I didn’t watch many videos either.  My library was dull and void.  But now, I have 532 songs occupying 2.7 Gibibytes of data, and I’m pretty sure less than 100 of those are English.  Some of the music I don’t expect to get any data from, music my friends made, or I don’t know the origin of at all, but I have a lot of Japanese singles that were openings and endings from anime, or were in an anime, but all of these singles also belonged to albums, or had album artwork, or an artist, or all kinds of rich information that isn’t in my library – or are in any of the main databases.

To top it off, I tried using some auto-tagging software I don’t remember the name of anymore, didn’t clearly understand the instructions, and screwed up the tags on a whole heck of a lot of my music, so now I have some songs I don’t know the names, artists, or album info to at all as its improperly labeled (and in Japanese).

Someone (I’d be willing to help any way I could) should compile a database of the way songs sound (Some type of wavelength ID that could easily identify a song via a piece of it, identify different versions, etc.), approaching music labels and artists from the United States, Britain, Australia, Japan, and all those other countries.

Or does such software already exist, and I simply don’t know about it?  If you know something I don’t, please leave it in the comments =)

Facebook Chat launches XMPP Support

Posted in Facebook, Facebook, XMPP on February 10th, 2010 by Navarr – View Comments

In a move that has me saying “Well its about freakin’ time!” – Facebook has launched XMPP Support for their popular Chat Service.

Now, normally I don’t take the time to write out about this kind of thing – except that no other blog post has detailed what your connection credentials are – so I’ll go ahead and write those for you.

Login: USERNAME@chat.facebook.com
Password: Your freakin’ Password

If you do not yet have a username (What the heck is wrong with you?  Why not?!) then you can create one at http://facebook.com/username/. (By the way, that’ll also be an email address soon, just so ya know).

Needed in (X)HTML 5 – An extension to the Meta Tag

Posted in (X)HTML 5 on February 2nd, 2010 by Navarr – View Comments

I was thinking today, while reading an article about redirect – that there is currently no way to accurately and semantically tell a user/bot that a web page is located somewhere else when you only have access to static (X)HTML files.  However, there is a workaround a lot of people use that dampens usability, and there is an attribute whose name would seem to imply that a way to do it should be possible.

By this of course, I’m referring to <meta http-equiv="" />.

Currently, people wanting to relocate their web pages rely on an older value to this tag that seems to have been originally designed for moving one person from one page to another in a set increment of time:

<meta http-equiv="refresh" content="0;URL=http://domain.tld/location" />

This doesn’t appear to be what this value should be used for, and has very negative consequences for search engines and parsers.  Instead, don’t you think we should be using http-equiv to its full potential?

To this, I propose the addition of <meta http-equiv="location" />, to properly match the HTTP Header for redirection.

I think there should be two ways to use this:

<meta http-equiv="location" content="http://domain.tld/location" /> and

<meta http-equiv="location" content="301;http://domain.tld/location" />.

Obviously, the second example gives us both a *three digit* HTTP Code, and the URL for redirection.  Since HTTP codes are only three numbers (though in the future may be greater digits) there still should not be any problem.