Mod Rewrite Tip
Posted by Jon on May 20, 2008
Just a quick mod_rewrite tip for everyone out there. I spent a little time today working on some rewrite rules for an upcoming feature on IntenseDebate. I didn’t realize before today, however, that query parameters are not part of the expression matching in mod_rewrite. That is, http://www.domain.com/url/param1/param2?abc=123, will stop matching after param2 in this case. When you think about it, this makes a lot of sense really…unfortunately I didn’t realize this until I spent a good 30-45 minutes in frustration wondering what was wrong with my regular expression. If you do want to do something with the query parameters you can access them by using the variable %{QUERY_STRING} in your script.
Hopefully this helps someone else out there.
Stats by email
Posted by Jon on Mar 30, 2008
As I’m sure most people do, I like to keep track of my Feedburner subscriber count. I don’t, however, want to display the subscriber count widget on my blog, and I definitely don’t want to have to log in to Feedburner just to check the current count. It’s just too much of a hassle and the truth is that I just end up forgetting and end up ignoring my blog. So instead, a little while back I setup a script to run once a week and go fetch the stats for my blog’s feed and email them to me. Getting the stats in my inbox allows me to stay current without having to remember to go check the site…if nothing else the email reminds me that I have subscribers and should probably get another post out (of course that doesn’t mean that I always do)…
All in all it’s the best method for me. I get the stats in my inbox and I don’t have to remember a thing, but I still get a constant, weekly reminder that I have a blog and that there are a few people that have (for whatever reason) subscribed to the feed.
I decided tonight to modify the script to email me my Twitter follower count once a week as well. It’s another stat I’d like to keep track of, but don’t want to go to the site to check. And of course another reminder to stay active. If you even remotely care about these stats I’d highly recommend doing something similar. It’s quick to setup (if you want the script I’d be happy to share it), and for me at least it makes all the difference in the world. I never used to keep track of these things, maybe check it once a month at most, and now I can get updates as frequently as I want without having to remember…freeing my mind to focus on other problems. Anytime I can do that it’s worth it for me.
Simple Things
Posted by Jon on Feb 8, 2008
Sometimes it’s the simple, but clever things that are most interesting. A great example is this post: Sniff browser history for improved user experience
To summarize the post, basically it describes a method to allow you to check if the visitor to a page has visited a specific url (or url’s) recently (ie is in the browser’s history). The idea is simple: apply a different color to visited links for a set of hidden url’s on the page, and then use javascript to check the color of the url’s. If the element has the color for visited links, then you know the user has been to that page recently (it’s in the browser history), and if not than the page is not in the history. Oh so simple, but quite clever.
The article mentions using this to dynamically show various subscribe buttons based on what rss readers are in your browser’s history, but I’m sure there are plenty of other practical applications as well. Kind of makes me want to clear my own browser history though…