Grenadine
6 August 2008
Grenadine is my XMPP bot for Twitter.
It is currently under development and not available for use or testing.
Here's a peek at the currently supported commands.

Yet another blog full of gas

Grenadine is my XMPP bot for Twitter.
It is currently under development and not available for use or testing.
Here's a peek at the currently supported commands.

Tom Morris is pulling his hair out dealing with XML character encoding issues. I've gone through this myself. I found that the SimplePie feed parser has great logic for dealing with this, so I adapted it to my needs in my PHP class XMLParseIntoArray. I think I've expanded on SimplePie's approach a bit, but it's still a work in progress. YMMV. Hope this helps.
Use a block like this in PHP code to detect whether or not it's running in command line mode as opposed to web server script mode.
// if $_ENV['SHELL'] exists, we're probably in command line mode
if (array_key_exists('SHELL', $_ENV)) {
$this->setOutputMode(MYSQLICIOUS_OUTPUT_CMD);
} else {
$this->setOutputMode(MYSQLICIOUS_OUTPUT_HTML);
}
I use Juice to manage my podcasts. But it doesn't do everything I need, and it's a little buggy, and I want to learn Python anyway. So I decided to download the latest source code and see if I could fix some of the bugs I've noticed and figure out how to extend it to do everything I need.
So step one was just getting to a point where I could compile it. The source code documentation is incomplete, so here's what I did, starting from scratch.
PHEW!
After all of that, it was actually fairly easy to build and install. However, I made the mistake of trying to upgrade the Universal Feed Parser, only to find that although Juice would still compile, install and run, it was silently crapping out while trying to read feeds so it would not actually update my podcasts. I reverted back to the version of UFP bundled with Juice and everything was fine (except for the UFP bugs I was hoping to have solved by using a later version, of course).
I should update this as things progress.
Maybe I'll write up something a little more formal in the future. For now, I just want to publish this in case it's useful to someone.
Les Orchard posted a blurb that indicated that he was looking for a PHP class to perform HTTP requests with conditional GET support. Well, a while ago I was looking for that, too. Because I was working on a replacement for Magpie RSS (see below), I decided to use Snoopy as my HTTP client. I then wrote a brief extension, Leash, to provide a cache-enabled front end to Snoopy. Leash automatically caches the HTTP results, the time of the request, and the Last Modified and Etag HTTP headers. When you request a page you've previously requested, Leash first checks to see if the cached copy is older than the maximum cache age you've specified (or the default of 1 hour), and if the cache is too old, Leash performs a conditional GET. The latest version of Leash (which I bundle with Snoopy) is in my Subversion repository.
Also in that repository is my replacement for Magpie RSS. I always liked Magpie, but it didn't quite work for me and I also wanted an OPML parser. So I wrote one. Actually, first I wrote a generic PHP XML parser. Then I wrote the OPML parser and Feed parser.
Sorry, but I currently don't have time for documentation. Or support. That probably makes this of very limited utility to all but the most daring. If you're a PHP junkie, you'll probably be able to peruse the code and get the gist. And here's an example of how I'm using it to help manage my podcasts.
I read this paper that Bruce Schneier linked to regarding JavaScript hijacking. Seems to me that WordPress plugin developers who piggyback on WordPress's builtin security features shouldn't have anything to worry about.
Judging from what little buzz there was, I think that's probably true, but I'm interested in others' thoughts.
tecosystems Redesign | alexking.org: Another good post by Alex King, this one about developing a new theme (and also about mixing business and friendship).
Dave Winer is looking for a developer to work on Share Your OPML.
If you're interested, I strongly urge you to pick up the baton. I can vouch for what Dave says in his post: he's demanding, but he really invests in the people with whom he works. As long as you're not a prima donna who cannot handle tough questions about your work, Dave has a lot to offer as a teacher and a boss. Actually, boss is a terrible word for the working relationship you can expect to have with Dave. He's an articulate collaborator with an insight into users' wants and needs that I find amazing.
Opportunity knocks. Answer the door.
Truly re-inspired by Dave's injection of interest into mobile news reading, I've been tinkering with my own custom solution. Since I subscribe to NewsGator, I'm using the NewsGator API for some backend, but I've done quite a bit of plumbing myself.
The most important things I wanted to be able to do were (1) to be able to mark posts read (and since I'm using NewsGator, that "read" status synchronizes across all my aggregator clients on different computers) and (2) to fix the annoying nonsense characters introduced by idiotic feed generators -- that includes the New York Times and Washington Post.
The results are starting to shape up nicely.
Here's the main page I see after I sign in.
And notice that in FeedDemon, "Chávez" is screwy, but I've got it right.
I released a bugfix for Optimal today. The latest version is 0.4c. If you haven't experienced any weird problems with the 0.4 release, don't bother updating.
Thanks to Chris Pirillo for bringing the problem to my attention and working through it with me.