Saturday, March 08, 2008
Yes! Dave implemented a workaround for the bug in the TinyURL API. Now I need to fix my Firefox bookmarklet. :-) ![]()
Wednesday, February 06, 2008
http://tinyurl.com/api-create.php is the endpoint for the TinyURL API. I works great, EXCEPT you cannot pass it a url-encoded url -- it will not decode the url and will instead give you a different (and wrong) tinyurl.
Generally, this is fine. However, if your url contains an anchor ("#"), then unless the url is encoded, the anchor and everything following it is truncated from your request somewhere along the way. I believe this is per the HTTP protocol, so it's at the web server level, not in the PHP scripting code behind the API, but it doesn't really matter. The point is that you can't get a tinyurl from a long url that includes an anchor, such as all the permalinks created by the OPML Editor.
UNLESS, instead of calling the API endpoint with an HTTP GET request, you send an HTTP POST request with your long url as the form data. See this example -- a hack of tinyUrl.create in the OPML Editor:
| bundle //init |
| if not defined (user.tinyUrl) |
| new (tabletype, @user.tinyUrl) |
| if not defined (user.tinyUrl.server) |
| user.tinyUrl.server = "tinyurl.com" |
| if not defined (user.tinyUrl.path) |
| user.tinyUrl.path = "/api-create.php" // 2/6/08; 12:58:37 PM by DM |
| if flUrlEncode // DON'T USE THIS - 2/6/08; 12:58:37 PM by DM |
| longUrl = string.urlencode (longUrl) |
| local (server = user.tinyUrl.server, path = user.tinyUrl.path ) // 2/6/08; 12:58:37 PM by DM |
| return (string.trimwhitespace (string.httpResultSplit (tcp.httpclient (server:server, path:path, method:"POST", datatype:"application/x-www-form-urlencoded", data:"url="+longUrl)))) // 2/6/08; 12:58:37 PM by DM |
This isn't a full-fledged bug fix, because I know Dave wants this script to be flexible enough to handle alternatives to TinyURL, but this hack does make the script work for OPML Editor style permalinks.
And again, this is actually a TinyURL bug -- web scripts should expect (if not require) GET requests to be url-encoded.
Need an alternative podcatcher ![]()
I've been using iTunes as my podcatcher for the last couple months (since I built my new computer), and I am pulling my hair out trying to work within its limitations.
I had been using Juice (formerly, iPodder) for a long time, and it was a good podcatcher with major limitations that I could script around. Unfortunately, Juice is no longer under active development, and I am not a Python programmer. So I am looking for an alternative.
I think Dave is working on his podcatcher, so maybe I'll spend a little time getting it to sync with iTunes.
First off, it looks like newsRiverSuite.podcatcher.storyArrivedCallback is just a quick-and-dirty first draft. It only deals with RSS2 enclosures, and it doesn't pay attention to the iTunes namespace. Thanks, to Dave's callback hooks, though, I should be able to work on this without monkeying with his code.
To be continued...
Tuesday, June 05, 2007
Just listened to an incredible hour of The Story - "Meeting Resistance." ![]()
Wednesday, May 02, 2007
Testing something over here... be back in a while. ![]()
Sunday, April 29, 2007
Cooool! Twitter friends! The next logical step ... make Dave's friends my friends with one click? ![]()

Monday, April 23, 2007
I'm keeping my attention stream on Twitter. ![]()
Monday, April 09, 2007
Mm-kay. Somehow, my OPML Editor subdomain was updating to the wrong place for the past week. Not that I've been doing anything other than trying to test the new build.... ![]()
Time to cancel my Verizon DSL. ![]()
Ever since we moved, they've been lying to us about speed of the DSL service we were paying for. After months of complaining and hours spent on hold, troubleshooting with tech support and waiting for technicians, it turns out our house is too far from the CO to qualify for ordinary high-speed DSL (i.e., 1.5 Mbps).
RCN, our cable TV provider, came by on Sunday -- that's right, Easter -- and installed a cable modem. Now I'm getting 10Mbps downstream and loving it!



