La Vita è Bella

Tuesday, April 24, 2007

Live Spaces suck, one more time

Live Spaces made some change days before, and that makes me unable to see any live space pages.

When I use Camino to visit live spaces pages, I always get a "XML Parsing Error", even the page I'm visiting is not the RSS but a html. When I use Firefox or Safari, I always get a HTTP 500 error.

The "XML Parsing Error" is really weird. It seems that the live spaces server send a wrong "Content-Type" so that Camino treat it as a XML document and try to parse it use a XML tree, and that failed (with "view source" I can see the html source corretly).

But Camino didn't have a extension like live HTTP headers to see what Content-Type do the server send, thanks to smorgan on MozillaZine Forums, I can see it using curl.

This is what curl get:

McManaman:~ fishy$ curl -v http://spaces.live.com -o /dev/null 2>&1 | grep Content-Type
< Content-Type: application/xhtml+xml; charset=utf-8

This is what Camino will get:

McManaman:~ fishy$ curl -v http://spaces.live.com -o /dev/null -A "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.4pre) Gecko/20070408 Camino/1.1b+" 2>&1 | grep Content-Type
< Content-Type: application/xhtml+xml; charset=utf-8

This is what Firefox will get:

McManaman:~ fishy$ curl -v http://spaces.live.com -o /dev/null -A "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0" 2>&1 | grep Content-Type
< Content-Type: text/html; charset=utf-8

And this is what Safari will get:

McManaman:~ fishy$ curl -v http://spaces.live.com -o /dev/null -A "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3" 2>&1 | grep Content-Type
< Content-Type: text/html; charset=utf-8

As you can see, for some common browsers, such as Firefox or Safari, live spaces server send the right Content-Type. For unknown browsers (including curl, Camino, etc.), it claims that it's "application/xhtml+xml". Oh my god, what did they think they are doing? What can they get from this Content-Type? I can't understand this at all.

So the only word I can say is, "live spaces suck, one more time"



tags: , , , ,

03:18:46 by fishy - w3c - Permanent Link

no comments yet - no trackbacks yet - karma: 36 [+/-]

Wednesday, December 14, 2005

3 problems in vim's ":TOhtml" feature

":TOhtml" is a great feature in vim. With it, we can generate syntax highlighted html for our code.

Set the following settings will make the generated html code more standard:

let html_use_css = 1
let html_no_pre = 1

But there're still 3 problems:

  1. The "body" tag begins with a "span" tag, which isn't allowed in xhtml. The whole body should be surrounded by a "p" tag.
  2. At the end of every line, there's a "<br>", which should be replaced by "<br />"
  3. Line number was filled with space to be aligned, which should be &nbsp;

Hope the 3 problems will be solved in vim 7.



tags: ,

10:26:06 by fishy - w3c - Permanent Link

3 comments - 1 trackback - karma: 3 [+/-]

Thursday, March 31, 2005

The correct way to use "alt" in images

Wanna post your e-mail address at your homepage, but be worried about the spam spiders? You can use a picture, just like what E-Mail Icon Generator do; Or you can use "_AT_" instead of "@", just like "foo_AT_bar_DOT_com". But neither is friendly, easy to use. You must type the email address yourself, you can't just copy & paste it.

So here's a solution for it.

Preparing 2 pictures, one for "@" & one for ".", just like the followings: the picture of "@" the picture of "."

Now, put them into your e-mail address, replace the real "@" and ".".

I guess you'll say, that don't work. Yep, it don't work, it isn't finished. Remember the title? Our focus is the "alt" attribute. Now, add the "alt" attribute into "img", which content is the one you've replaced: "@" or ".", see the following html code:

foo<img src="http://wang.yuxuan.org/pix/at.png" alt="@" />bar<img src="http://wang.yuxuan.org/pix/dot.png" alt="." />com

Here's the effect:

foo@bar.com

Copy it, and paste it to the "To" field in your mail client. If you're using Firefox, you'll get the perfect e-mail address. If you're using ie, unfortunately, you'll only get this: "foobarcom". Stupid ie can only show the stupid tooltip(maybe you should add a title="" to stop ie from showing the stupid tooltip), but not process "alt" correctly. So, you should throw your ie into trash now.

That's not the end. If you're lazy, don't wanna prepare the 2 pictures, just omit the picture thing, like this:

foo<img src="http://where/is/my/picture/at.png" alt="@" />bar<img src="http://where/is/my/picture/dot.png" alt="." />com

See what?

foo@bar.com

Stupid ie will give you a stupid cross, but in Firefox, it's correct and copyable.

Yeah, trash your ie today. Now.



tags: , , , ,

18:33:00 by fishy - w3c - Permanent Link

no comments yet - no trackbacks yet - karma: 21 [+/-]

May the Force be with you. RAmen