While working on my Recommended Links plugin, I wanted a way to auto-populate the link title field based on the URL entered. I was stuck for a while dealing with cross-domain XHR issues and initially fell back to using a WP Ajax request, using wp_remote_get to get the remote link and returning that to PHP… however, it was slow and not all that elegant. Why bootstrap the entire WP environment for one simple Ajax request?

Did some researching, though, and I discovered YQL, which I had played with before, but never thought of as a tool for getting around cross-domain request issues. Apparently, however, its been widely used for that purpose for a year or so — there’s even a jQuery plugin that converts all external Ajax requests to YQL queries. Sweet!

The one problem I had, though, was that YQL’s html table only includes the <body> element, and I wanted to retrieve the <title> text.

So I looked through the Open Data Tables available, and lo and behold, there’s an htmlstring table that returns the entire html of a document as a string. So all I had to do was a little regex matching to find the <title> element, and I was all set.

— Read more —

I’ve been using Ubuntu Linux on my laptop exclusively for about four months now, after having grown accustomed to Windows machines over many years. I jumped in headfirst, figuring that was the only way to actually learn the ins and outs of Linux. So far, its been great, and there are very few things I miss now. I left about a quarter of my laptop’s hard drive partitioned for the Windows 7 install that it came with, and up until this past week I’d booted up Windows at most 4 times… for a conference call on GoToMeeting, to slice a Photoshop file I couldn’t handle in Gimp, and a couple other odds and ends.

But… there are a few times in a web developer’s career that having a Windows machine is a necessity. When you have a client that demands their design work in IE6, for example… I tried everything I could think of in Linux, running Internet Explorer under WINE (kinda worked for me with IE7, but I couldn’t run IE6 at all), trying IETester in PlayOnLinux (pretty much a complete blowout in my experience)… so I finally started looking at using the Windows partition of my hard drive for something other than empty space.

I tried a number of ways to share my work-in-progress between my Linux and Windows partitions, but this is the one which ended up working for me. I found bits and pieces of it various places online, but I didn’t see it put together anywhere, so I’m posting this in case anyone else finds it useful.

— Read more —

As I’ve been mentioning a lot lately, I’ve been using the BackPress library in more and more projects as time goes on. I’m playing around a bit these days with Django and CodeIgniter, both of which I really like, but my mind hasn’t really shifted to the MVC model yet, and when I need to get something done quickly, I find myself starting it up in BackPress.

I gave an Ignite talk on BackPress last weekend at WordCamp Seattle. It was fairly disjointed, and I’m a long way from being comfortable with speaking to a group that size, but here are my slides, for anyone who wants to be introduced to this library:
— Read more —

One of my favorite political news sites for several years has been Counterpunch, and lately, with all the news coming out of Tunisia, Egypt, and the Arab world, I’ve found myself visiting their site a couple of times to read up on current events and analysis.

Actually, its a site that I would like to keep up with more regularly, and I probably would, too, if the 1997-style website didn’t make it so hard to keep up with. Seriously, its still maintained in Adobe PageMill. In 2011. Last time I opened that program was probably 1998, and even then it was dated.

— Read more —

I recently answered a support question on one of the WordPress question and answer sites about forcing pdf links to download in Acrobat or another pdf application, rather than opening in the browser window. I came up with what I thought was a pretty elegant solution, which involved creating a pdf.php template which set the HTTP headers necessary to force a download, rather than allowing the browser to attempt to render the file.

— Read more —

Spent the day learning a little more about the walker class that handles WordPress 3.x’s nav_menu structure. I can’t say it was easy. Having to extend Walker_Nav_Menu and overwrite the instance methods just to do something as simple as adding a <span> element within a list item seems a little counterintuitive. But for now, this is the best and most extensible way of handling menus that the user may need to update, so it seems worth knowing about.

— Read more —

I was recently working on a WordPress project that required a specialized front-end panel for users to add new posts, including images and videos. Adding a post wasn’t a challenge, but handling file uploads was looking like a pain… at least trying to follow the codex documentation. After browsing the wp-includes core files for a few hours, though, I found a much easier way of handling it.

— Read more —

For all the publicity and money the Diaspora project has raised lately ($175,000 raised without sharing a single line of code!) with its unstated promise to “take on Facebook”, one thing that’s getting lost is that several other projects have been working for years on similar frameworks… mostly in obscurity and without media attention, but nevertheless working out standards and code to back up a distributed open-source social networking platform.

The Appleseed Project was probably the first project of its type. Started in 2004, apparently abandoned for few years but recently reinvigorated, Appleseed is truly open source distributed social networking… like Diaspora, but with working code.

I recently got my first WordPress plugin indexed in the wordpress.org repository. It’s a piddling little widget, nothing too impressive, but the process itself was very satisfying, and one that got me appreciating in a much more direct way all the work that all the thousands of contributors put into this open source project.

— Read more —

Ta-nehisi Coates kills it as usual in his riffs (here and here) on Obama’s speech at Hampton’s graduation, where the prez warned students (and their parents) against the dangers and distractions their newfangled technology — “iPods and iPads and Xboxes and PlayStations” — pose; the fear that with new media, “information becomes a distraction, a diversion, a form of entertainment, rather than a tool of empowerment, rather than the means of emancipation.”

Comments range from betrayed (“we thought we was hip, one of us”) to cynical (“this probably plays really well to the conservative middle aged crowd”) to just sad (“it just hurts to see someone smart pretend ignorance to fit in”). But with all that out of the way, there’s a decent defense of the geek worldview in there.