torsdag den 18. juni 2009

Byte 16314

I have made some additional changes to WallRush.com, among other I'm slowly working on showing who added the material. No rush though. Also I changed the way hits on vidoes are weighted against the freshness of the video, so that, hits counts 30% and freshness 70%. This seems to be a reasonable ratio, but it might turn out that 80-20 is even better.

I also remade Qys.dk entirely moving the Quick ASP Upload site to its own subdomain. I also had a glance at what people have uploaded the last 2 months. One word: Insane.

As a last note; is it possible to have a nightmare about an access denied error when trying to write to a file at byte 16314? The answer seems to be yes.

lørdag den 6. juni 2009

Parsing xml

So I have updated the video add section so that videos are automatically resized to 450 * relativeheight. This required parsing of the html/xml the user supplies, and I chose only to allow, attributes and tags that are needed to show the embed (embed, object and param tags).

I am going to mess around with this a bit in order to make sure that hostile input is filtered correctly.

onsdag den 3. juni 2009

Annoyance

Yes I am very slowly developing WallRush, but I guess there's some progress. I have finally cracked the RSS import problem - mostly. First of all I wanted it to be able to handle both normal RSS and ATOM. This isn't a crazy thing to demand, so I naivly thought i could use the XMLDoc object to parse both formats. I was wrong - some feeds are invalid and there's no way to make XMLDoc read invalid XML.

Workaround?
It seems, that microsofts implementation of the xmlhttp object believes that it should always use UTF-8 encoding if the mime-type is text/xml, when the responseText is accessed. This is bad, because ASP doesn't - to my knowledge - let me encode text as I please, and lets pretend i might losen up a bit on the parsing of invalid XML by writing my own parser. In that case I have to work with malformed text when using the responseText property. I tried to use the Text property of the responseXML, however it failed in the same manner as responseText returning malformed text because the it was incorrectly encoded with UTF-8.

Why can't i just use responseXML and the XMLDoc object? Because it refuses to parse invalid XML, and I can't expect everyone to pass valid XML every time. I'm of course not the only guy with this problem and it seems that using ADO to fetch the feed, it might be possible to decide the encoding of the text, but I will have to look into that.

However not all is bad. The import feature works again, just not with foreign character sets (like danish). I fixed the object_hit function so preferences is now recorded again for videos. I also changed some of the graphics. I think it is much better now. And i added a list of available videos so that i don't have to go through them all to find those I am interested in.