agent page 2 - Dave's Blog

Search
My timeline on Mastodon

WebAIM: Blog - History of the browser user-agent string

2008 Sep 8, 7:00A brief history of user agent strings in web browsers, culminating in: "And thus Chrome used WebKit, and pretended to be Safari, and WebKit pretended to be KHTML, and KHTML pretended to be Gecko, and all browsers pretended to be Mozilla, and Chrome called itself Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13, and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded."PermalinkCommentshumor internet browser mozilla google chrome user-agent ie

Bomb Or Not? Training For Government Agents!

2008 Jul 30, 1:59Training website to determine what's a bomb. E.g. Catwoman movie poster: "While the movie was bad, and therefore in a way "a bomb", the poster does not pose a threat to anything, not even air travel."PermalinkCommentshumor security bomb government satire travel airport

TESLAKITE free MP3s

2008 Jul 11, 1:39Some tracks from Paranoia Agent released by the composer Susumu Hirasawa. That series freaked the hell out of me.PermalinkCommentsanime music mp3 paranoia-agent susumu-hirasawa

Ex College Roommate News

2007 Nov 9, 2:38Jon's leaving for Germany today which of course is sad. On Wednesday, Jon came over and we watched Hackers. There's a few things you probably wouldn't notice without repeated viewings of the film: In similar ex college roommate news, I'm going to California over the weekend for Angie and Kane's goodbye party. They're heading for Australia for like a year or something. Angie's got a blog about her travels but rarely seems to update it. I'll get to see Carissa and Elijah there too, almost completing the ex college roommate experience. To avoid confusion I should mention that unlike everyone else I know, Carissa and Elijah aren't leaving the country.PermalinkCommentspersonal nontechnical

Second Life Translator

2007 Jul 4, 10:58Hackdiary
I really enjoy reading Matt Biddulph's blog hackdiary. An entry some time ago talked about his Second Life flickr screen which is a screen in Second Life that displays images from flickr.com based on viewers suggested tags. I'm a novice to the Second Life scripting API and so it was from this blog post I became aware of the llHTTPRequest. This is like the XMLHttpRequest for Second Life code in that it lets you make HTTP requests. I decided that I too could do something cool with this.

Translator
I decided to make a translator object that a Second Life user would wear that would translate anything said near them. The details aren't too surprising: The translator object keeps an owner modifiable list of translation instructions each consisting of who to listen to, the language they speak, who to tell the translation to, and into what language to translate. When the translator hears someone, it runs through its list of translation instructions and when it finds a match for the speaker uses the llHTTPRequest to send off what was said to Google translate. When the result comes back the translator simply says the response.

Issues
Unfortunately, the llHTTPRequest limits the response size to 2K and no translation site I can find has the translated text in the first 2K. There's a flag HTTP_BODY_MAXLENGTH provided but it defaults to 2K and you can't change its value. So I decided to setup a PHP script on my site to act as a translating proxy and parse the translated text out of the HTML response from Google translate. Through experimentation I found that their site can take parameters text and langpair queries in the query like so: http://translate.google.com/translate_t?text=car%20moi%20m%C3%AAme%20j%27en%20rit&langpair=fr|en. On the topic of non US-ASCII characters (which is important for a translator) I found that llHTTPRequest encodes non US-ASCII characters as percent-encoded UTF-8 when constructing the request URI. However, when Google translate takes parameters off the URI it only seems to interpret it as percent-encoded UTF-8 when the user-agent is IE's. So after changing my PHP script to use IE7's user-agent non US-ASCII character input worked.

In Use
Actually using it in practice is rather difficult. Between typos, slang, abbreviations, and the current state of the free online translators its very difficult to carry on a conversation. Additionally, I don't really like talking to random people on Second Life anyway. So... not too useful.PermalinkCommentspersonal translate second-life technical translator sl code google php llhttprequest

About Conditional Comments

2006 Apr 4, 5:30Conditional Comments and the Version Vector may be used to identify the browser version displaying an html page.PermalinkCommentsconditional-comment version-vector ie html web internet user-agent development dhtml reference msdn microsoft javascript

Web Browser User-Agent Information - Change IE's User Agent

2006 Feb 22, 2:28PermalinkCommentseric-lawrence fiddler http user-agent ie internet http-header
Older EntriesNewer Entries Creative Commons License Some rights reserved.