sorry for the noise
Apologies if you’re reading this via a reader.
I discovered a bug in twitter tools and decided to fix it.
The bug was that it wasn’t linking to hash tags properly because it had some weird regexp that limited it to 15 characters.
I hate fixing regexps. Really. Especially in a language that I don’t know, aka php.
But a few test iterations later (which is the noise you saw), I’ve got something that works.
Here’s a patch for anyone that’s interested. Too bad Alex King will probably never see this, since it’s not very easy to send him email.
--- twitter-tools.orig/twitter-tools.php 2009-08-03 10:37:38.000000000 -0700
+++ twitter-tools/twitter-tools.php 2009-11-26 00:19:43.436657000 -0800
@@ -595,7 +596,7 @@ function aktt_profile_link($username, $p
}
function aktt_hashtag_url($hashtag) {
- $hashtag = urlencode('#'.$hashtag);
+ $hashtag = urlencode($hashtag);
return str_replace('###HASHTAG###', $hashtag, AKTT_HASHTAG_URL);
}
@@ -834,10 +835,10 @@ function aktt_make_clickable($tweet) {
, $tweet
);
$tweet = preg_replace_callback(
- '/\ #([a-zA-Z0-9_]{1,15})/'
+ '/#([a-zA-Z0-9_])*/'
, create_function(
'$matches'
- , 'return aktt_hashtag_link($matches[1], \' #\', \'\');'
+ , 'return aktt_hashtag_link($matches[0], \'\', \'\');'
)
, $tweet
);
Yay for open source.
2009
26
Nov
- Posted by alex at 02:26 am
- Permalink for this entry
- Filed under: geek
- RSS comments feed of this entry
- TrackBack URI
holy smokes. i had 19 updates to your blog this morning. at least they were all short! ;-)