Saturday, June 9, 2007

Optimal OPML Browser & WordPress Plugin

I've been meaning to put up my reading list on my personal blog (Tome of Wisdom). I needed three things:
  • An easily updateable news aggregator that supports publicly sharing an OPML file.
  • An OPML reader that displays my newsfeeds in their proper categories.
  • Integration with Wordpress (which my blog runs on), either through a plug-in or a widget
After some Googling, I found the first requirement met in Bloglines, and the others met in the Optimal Browser. The Optimal Browser is very flexible and has a pretty slick interface. It can read an OPML file locally or remotely, and displays expandable categories with expandable RSS feeds!

I installed it, and lo and behold, it didn't work.

The only information I had about the error was "Error reading OPML file," as well as the url of my OPML file and the cache file. How useful. Not.

I tried enabling allow_url_fopen in PHP, as specified in the site's help, by creating a php.ini in my account's root directory. No luck. "Maybe I'm just not doing this right," I thought, "and I could spend hours trying to figure this out. Maybe I'll try installing Curl instead to avoid this particular headache."

Well, installing extra *stuff* in PHP is a headache in itself. There's no easy way to add modules, like in more sane languages such as Perl and Java. To install extra modules not included in the base package, you actually have to RECOMPILE the whole damn PHP package. If I had to actually do that manually in the shell, I'd rather shoot myself.

Luckily, there are easier ways, assuming your server has WHM/Cpanel installed. One way is to use the EasyApache in the shell. The script is usually located at /scripts/easyapache. An even easier way, if you hate the command line as much as I do, is to use EasyApache from within WHM itself. Just log into WHM, find the "Apache Update" link, select your options, and away you go. Easy as pie.

Well, I installed Curl, and it still didn't work. I still had the exact same error. I tried looking at the settings.optimal.inc as specified in the help, but the paths were all correct. I tried uploading the file to my server so it could read it locally, but still no luck. So then I tried modifying the plugin code to output the path AS WELL AS the url of the OPML file. I noticed a small little thing: there was a space between the path and the local url.

Aha! The instructions on the web site said to use this syntax to include the OPML reader on a Wordpress page:
!OPMLRender : url,updatetime,css class,depth,flags
When somebody gives you a syntax definition, you had better use it exactly as given, otherwise you're program won't work. In this case, however, the definition is wrong, and using it as stated will break the code. If you put a space after the colon, it's counted as part of the URL!

Once I fixed this problem, I got another error message! Woo hoo! Change is good! The error was "No valid XSLT processor found." This turned out to be an easy fix. I just ran EasyApache again and recompiled PHP with "Dom XSLT."

Conclusion: Giving incorrect syntax instructions is a cardinal sin. My Outragemeter just maxed out.

3 comments:

Anonymous said...

скачать скриншоты с фильма школьница http://free-3x.com/ порно видео с школьницами free-3x.com/ молодые чернокожие порно онлайн [url=http://free-3x.com/]free-3x.com[/url]

Anonymous said...

free viagra samples before buying is there a female viagra uk alternative viagra viagra and alcohol free viagra samples before buying viagra prices buy viagra in canada is viagra safe for women viagra soft tabs cheapest uk supplier viagra viagra doseage viva viagra how viagra works generic viagra india

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!