Saturday updates
The Big
My “convert links” function, which basically runs through each tweet and makes all links, @mentions and hashtags clickable, has never been bullet proof. I catered for numerous situations where extra character might have been present before or after the text attempting to be linked. A basic example, (@username) would work fine, but (@username!) wouldn’t, the ! would get included in my link and render it useless. It was time to start again.
So I’ve rewritten my entire function, and its now about 1/4 of the code it used to be and it works much better (if you find something that doesn’t appear to be working correctly, let me know). I had a bit of a dig through twitter’s JS widget to see what regular expression(s) they were using (figured they should have a pretty good grasp on what works best). In addition to link, mentions and hashtags I’ve also added support for “stocktwits”, in the format $ABCD, these currently link through to stocktwits.com, but this might be “tweaked” if I’ve got time.
The Small
Knocked off a bunch of small things that I’ve been meaning to fix/add for a while.
- Added refresh button to the header (same as Hahlo 3)
- Added a back button which is only shown when running Hahlo4 in standalone mode on you iPhone
- Fixed a few things I’d missed when updating the tweeting/messaging screens a couple of days ago, mainly the loading spinner doesn’t sit on top of the character counter anymore.
- Updated oEmbed support to include support for flickr’s short urls (in the form http://flic.kr/p/ABCD, also added support for flickr videos (although they’re flash so obviously they will only work in desktop browsers)