c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel

Latest Updates: blogging RSS

  • erik 11:52 am on September 20, 2008 | 1 Permalink | Reply
    Tags: blogging, ,

    Thank you for the free book!

    Since I started working through the Personal MBA reading list, I’ve been posting summaries and links to the books on Amazon. If you’re reading this blog, you’re savvy enough to know that those Amazon links are “associate” links, meaning that they generate referral money (well, Amazon gift certificates) for me if you click-through and buy a book.

    I’m happy to say that a few people have bought some of these books, and I’ve made enough referral money now to pick up a free book! I decide to buy “Innovation and Entrepreneurship” by Peter Drucker. Innovation, and the application of innovation as a competitive strategy, is a topic I’m particularly interested in. In addition, I really enjoyed Drucker’s “The Effective Executive“, so I’m looking forward to reading more of his work.

    So thank you! Reading this next book will be even nicer knowing that my friends (and some strangers) were willing to share their “click-throughs” with me!

     
  • erik 7:18 pm on May 9, 2007 | 2 Permalink | Reply
    Tags: blogging

    WP update b0rked my full-post feeds

    I just noticed today that my WordPress installation has switched itself over to partial/summary feeds instead of full-post feeds. I’m not a fan of partial feeds, but it seems that WP isn’t agreeing with me. Even after the 2.1.3 update, and installing the Full Text Feed plugin, it still doesn’t seem to be working. If you have any ideas, I’m all ears; otherwise, I’ll poke around a bit more and see if I can track down the cause.

     
  • erik 1:23 pm on December 30, 2006 | 10 Permalink | Reply
    Tags: blogging, , , , ,

    Moving my blog from WordPress to Django; Part 2: Migrating the data

    In Part 1 of this series, I described some of the motivation, and the components being used to build a new blog for myself. In this (lengthy) post, I’ll address the solution I used to move my content archives from WordPress to the new app.

    Installing new blog software is generally easy, but if you have legacy content that you need to preserve, the ability to move content between systems becomes of utmost importance. Fortunately, it’s quite common for popular software to provide import/export features; Having good tools to migrate content reduces switching costs, making it easy to try new software without fear of content lock-in. Unfortunately, with a home-grow blog platform, these tools need to be written from scratch.

    For my soon-to-be-launched Django-based blog, importing content from my WordPress installation was an early priority — there’s only so much testing you can do with lorem ipsum posts. In tackling this content migration, I considered the following four options:

    1. Support the legacy database schema.
    2. Export and Import at the database level (ie., SQL dump, some text file munching, and SQL imports.)
    3. Write an adapter layer to pull from the existing database and insert into the new database.
    4. Export the content into a neutral format, and import from that format.

    Regardless of the approach taken, I also added one important requirement: The import solution had to be so easy (and easily repeatable) that I would never hesitate to make a change to the database models when needed. Naturally, it’s nice to freeze the model once you have a stable release, but during development, even the database model should be open to agile iteration. I’ve worked on systems where every model change meant writing accompanying SQL scripts to alter the tables, and while effective, it wastes time, and I wanted the option to simply export, wipe the database clean, and re-import whenever needed. (And preferably by simply running a single script.)

    I finally settled on option #4, to export into a neutral format (XML), and write an importer for that format; However, I did briefly consider each of the above options:

    1) Supporting the legacy (WordPress) database schema sounds nice on the surface. This would allow the two systems to share the same database (thus eliminating the need to migrate content at all), while making it extremely easy to run the systems side-by-side (perhaps even balancing traffic between the two to test the deployment.) The downside though, is that the custom application would need to maintain the data relationships that WordPress was relying on. It’s certainly doable, but on further investigation, I found that I didn’t actually like everything about the WordPress schema; There was a bit too much de-normalized data that I didn’t want to keep around.

    2) Exporting and Importing at the database level would essentially involve a mysqldump, some sed/grep/perl magic, and a SQL import into a new database. This would get the job done, but could very well lead to endless hours of tweaking regex patterns; and the end result would basically be throw-away code.

    3) Writing an adapter layer was actually the most tempting at first. I knew that Django contained a tool for generating model definitions based on an existing database schema. If this worked for the WordPress database, then all I would need to do is write a thin layer to fetch content from one model and stick it into another. Sure enough, the `inspectdb` tool did do a good job, and I got so far as having routines for pulling posts and comments before realizing that this also wasn’t as reusable a solution as I wanted. Complicating matters was the need to do all this magic in a single database, since the Multiple Database Support branch of Django is still in development/testing.

    With the above options scratched off the list, I went in search of a means to export directly from WordPress into a neutral format. With a little googling, I found some posts about an export/import feature that might be “in development” in the WordPress tree, but I found no documentation on the feature. Fortunately, a few more searches turned up the “WordPress XML Export” plugin, which sounded like an effort to backport the exporting feature to early versions of WordPress. After first installing the XML Export plugin, I found that it didn’t actually work with the version of WordPress on my server, but a quick look through the source code revealed a hardcoded version check that was easy enough to modify. With that change made, the plugin has run like a champ ever since.

    The XML Export plugin outputs the full contents of a WordPress blog into a WXR file (WordPress eXtended RSS), which is an RSS 2.0 file, extended with a wordpress export namespace so that it can include extra metadata and comments.

    With the content archives now in a massive RSS file, the next task was to write an importer. To parse the XML, I decided to use ElementTree for it’s simplicity in getting the job done. Pulling the file into ElementTree is a one-liner (when wordpress_xml_file is a File object):

    tree = ET.parse(wordpress_xml_file)

    The entries can be easily iterated:

    for item in tree.findall("channel/item"):

    Extracting the basic elements was also straight-forward (which I stuck into a Dictionary):


    results['link'] = item.find("link").text
    results['pubDate'] = item.find("pubDate").text
    results['summary'] = item.find("description").text
    results['body'] = item.find("{http://purl.org/rss/1.0/modules/content/}encoded").text
    results['post_date'] = item.find("{http://wordpress.org/export/1.0/}post_date").text
    results['post_date_gmt'] = item.find("{http://wordpress.org/export/1.0/}post_date_gmt").text

    Extracting the Categories/Tags was only slightly more work:

    
    results['categories'] = []
    
    categories = item.findall("category")
    
    for c in categories:
        results['categories'].append(c.text)
    

    Pulling the comments was the only messy part of the process. The list of comments is easy enough to fetch…

    comments = item.findall("{http://wordpress.org/export/1.0/}comment")

    …but extracting the actual comment text is a little more work because some comments may contain child nodes. For example, a comment containing a hyperlink, bold tag, or any other HTML will be truncated if you simply use the `.text` attribute. To crawl the comment text and child tags, I used the `getiterator()` method, while concatinating `.text` attributes to assemble the full comment text. While doing this, I also decided to filter out any HTML tags from the comments, which made the process fairly simple:

    
    tmp_comment_list = []
    
    comment_tag = comment.find("{http://wordpress.org/export/1.0/}comment_content")
    
    for comment_tag_child in comment_tag.getiterator():
        tmp_comment_text = comment_tag_child.text
        if tmp_comment_text: tmp_comment_list.append(tmp_comment_text)
    
    the_comment['body'] = ' '.join(tmp_comment_list)
    
    results['comments'].append(the_comment)
    

    By writing an importer for the WXR/RSS 2.0 format, this not only solves the problem at hand, but also sets the groundwork for a reusable RSS importer. IMO, this potential reuse adds additional value to the solution (as opposed to one-off SQL munching or custom adaption layers), which makes it worth any additional work that might have gone into it. With a little re-factoring, the same system could also be extended to support the Movable Type Import Format, making the software very easy to setup and evaluate.

    In Part 3, I’ll skip some of the development details and jump into the server issues, with a focus on why the new blog hasn’t launched yet. The answer lies heavily in the challenge of running a Python-based application server in shared hosting environments. The common lack of mod_python, the RAM hit, etc., all add to the complexity in adopting Django.

     
  • erik 6:41 pm on December 27, 2006 | 3 Permalink | Reply
    Tags: blogging, , ,

    Moving my blog from WordPress to Django; Part 1: Assemble the wheel, don’t reinvent it

    I was hoping to write this post as an announcement for my new blogging solution, but instead (since I haven’t flipped the switch yet), I thought I’d start off with why I’m doing it, and what software I’ve pulled together to keep from reinventing the wheel. (In future posts I’ll address the development itself, the unique features, and the major obstacles in moving from a WordPress installation on a shared server, to a custom web app written using Django. This last bit, the actual hosting of a Django app, is a significant one, as it is the primary issue causing a delay in switching over).

    I moved my blog to WordPress software (from PyBlosxom, and a number of home-grown solutions before that) back in April 2005. I’ve been quite happy with WordPress, and would definitely recommend it for anyone who doesn’t enjoy coding (and maintaining) their own web apps. After writing a few custom plugins and a plain, but functional theme, my WordPress-based blog has been churning reliably for well over a year. However, after also using Django for over a year to build other web apps, it became too tempting not to use Django for my own site. (It really is a great framework to work with, particularly if you’re a fan of Python.)

    Building a custom app isn’t all roses and cherries. (I’m not sure what that means, but it sounds good.) With an established open source solution like WordPress, you have access to thousands of testers and hackers, all working to ensure that the software is reliable. You have access to good documentation, and plenty of bloggers who post solutions for custom integration problems. Furthermore, with PHP support being almost ubiquitous in shared hosting environments, you can have a WordPress installation up and running in a matter of minutes.

    With a home-grown system, you do ALL the heavy lifting in development, testing, and maintenance, and in that regard, you’re re-inventing the wheel in some areas, and leaving a community of support behind. Viewed in this light, it seems a little silly to build a custom solution when a proven, free system already exists. But custom apps can have their advantages if you can still leverage some open source communities while assembling a solution that is architected to address the specific needs you have. In my case, I tried to do as little custom, one-off engineering as possible (expect in the fun areas), while enabling a unique flexibility to re-think content interaction on my blog. I wanted the ability to prototype new feature ideas at the speed of Python + Django (which is to say, very fast), but not get bogged-down debugging ORM’s and template engines. (I’ve spent plenty of time doing that in the past.)

    Not wanting to write everything from scratch, my new solution is LAMP based (Linux [Ubuntu to be specific], Apache 2, MySQL, and Python), using the Django framework for it’s generated Admin CMS, object-relation mapping library, templating engine, URL mapping, etc. In other words, the only thing not leveraged from the open source community is the actual business logic of my app (which in a blog, can be quite simple.) I’m even leveraging external services like Akismet (for filtering comment spam), and del.icio.us, flickr, and Technorati for pulling in external content and metrics. I’m also using ElementTree (for the XML parsing in my content import system), Pygments (for syntax highlighting the code embedded in blog posts), simplejson (for generating JSON from Python objects), PyTechnorati (for accessing Technorati’s API’s), the Universal Feed Parser (for pulling in external RSS/ATOM feeds), and the Yahoo! Interface Library (for the CSS Fonts and Grids libraries.) During development, I’ve also relied heavily on Subversion and Bazaar for my revision control needs.

    With this arsenal of open source software, I was able to feature-match the bits I wanted from WordPress rather quickly, and then iterate on the presentation and interaction without the burden of implementing everything from scratch. Needless to say, I’m excited about the new site (it’s been running parallel to my WordPress blog for several months), and I’m eager to see what happens when I finally flip the switch and start routing traffic to it!

     
  • erik 9:02 am on October 25, 2006 | 0 Permalink | Reply
    Tags: blogging, ,

    Collecting Python for S60 success stories

    Even though I find the title a little inappropriate (sorry, Kevin), there’s a question being posed over on the Forum Nokia blogs that’s worth responding to if you happen to use Python for S60:
    What’s Python good for, anyway?

    Kevin Sharp (the post’s author, and one of Nokia’s Technical Editors), is looking to help promote Python for S60, but first needs to collect some success stories.

    I know there’s a few of you who drop by this blog from time to time that are doing amazing things with PyS60. If you can spare a few minutes to write a response, it would be a great help to the project. Thanks!

     
  • erik 10:53 am on October 4, 2006 | 0 Permalink | Reply
    Tags: blogging,

    Switching to Google Reader

    I’ve been a long-time NetNewsWire Pro (NNW) user, and still contend that it is one of the nicest desktop aggregators to read news in. With Bloglines and Newsgator integration, and some voodoo syncing features, NNW also makes it easy to roam between OS X machines. However, at home, I spend more time on my Linux box, and NNW’s Mac-only status means I need a different client. Furthermore, I complicate matters by occasionally wanting to check my feeds from my phone or Nokia 770. Realizing that a desktop client wasn’t going to solve my roaming needs, I’ve played with a number of web-based aggregators, but I’ve always found them lacking a bit. That is, until I tried the Google Reader redesign last week…

    Moving from NNW to Google Reader was as easy as expected. It was simply a matter of exporting subscriptions to an OPML file, and uploading that file to Google Reader (under Settings :: Import/Export.)

    Using Google Reader is quite pleasant. The big feature they nailed is the manner in which it can automatically flag posts as “read” once you’ve scrolled past them. This alone improves the interaction tremendously over other online readers I’ve tried. Furthermore, when you combine keyboard navigation, it’s easy to crank through news or scan headlines when you have a few minutes to spare. And finally, of course, roaming between machines is a breeze (though I haven’t tried it on the 770 just yet.)

    If you haven’t read about the redesign work Google has done on Reader (and you’re interested in RSS/Atom aggregators, or slick AJAX apps in general), check out the Official Google Reader Blog for details.

     
  • erik 10:29 pm on July 2, 2006 | 1 Permalink | Reply
    Tags: blogging, ,

    Blogging with TextMate

    I’ve been using TextMate to write my blog posts for quite some time now. I enjoy the convenience of MarsEdit, but TextMate lies in the center of my GTD process, and it’s such a nice text editor that I hate to leave it. Of course, actually making blog posts has required a little copy/paste action to my web CMS, but not anymore — TextMate now has a Blogging Bundle! Check out the screencast to see it in action. (And yes, this post was made directly from TextMate ;-)

     
  • erik 4:48 pm on May 25, 2006 | 0 Permalink | Reply
    Tags: blogging,

    Comment spam on the rise

    FYI, I started getting comment-spammed out the wazzu last week — several hundred a day, and some of them started slipping past my spam filters (HashCash and Akismet.) Apparently I need to load up the armor a bit more, so until then, I turned moderation ‘on’ for all comments so that these pesky spammers don’t get through.

    If you have any suggestions on other WordPress spam filters, please let me know!

    Cheers,
    Erik

     
  • erik 12:41 pm on March 27, 2006 | 1 Permalink | Reply
    Tags: blogging, , ,

    Great corporate blogging: Why Adobe CS2 isn’t coming to MacIntel

    Here’s a great example of using a corporate blog to explain an unfortunate product decision to customers, “Living Photoshop: Macintosh and the Intel switch“.

    The blogger, Scott Byer, is explaining why Adobe isn’t going to release a MacIntel version of CS2 — the summary being that transitioning their entire development over to XCode wasn’t feasible for CS2. It’s what Adobe’s Mac customers need to hear (that there’s a significant technical hurdle which didn’t make sense for a product currently in the market), but it’s not the kind of thing that a press release can explain. In other words, it’s important information, but without bloggers, there’s no clear channel for how to communicate this stuff.

    It’s also of note that the comments list (the conversation) stretches far beyond the length of the original post. The customer feedback is mixed — ranging from “You guys suck, I spent $1000 on this software!”, to “Yeah, I understand the challenge first hand. Thanks for the explanation.”

     
  • erik 1:50 pm on November 29, 2005 | 0 Permalink | Reply
    Tags: blogging,

    Adsense updates, “advertise on this site”??

    I never see them because I run Adblock in Firefox and PithHelmet in Safari, but I do actually use Adsense on my blog. I don’t make any money off of it (really, I’ve earned like fifteen cents this year, which means I’ve taken home $0), but I wanted to try it out so that I’d have first-hand experience with the service.

    Since the ad revenue (*laugh*) doesn’t do anything to help operating costs, I’ve thought many times of taking them off; And this latest Adsense update just about made me pull the trigger. From the November Adsense updates comes this feature: “Gain new advertisers directly from your webpages.” The idea is pretty slick — the service allows an advertiser to directly buy AdWords advertising space on sites they’d like exposure on. Such purchases then pay a premium to the site owner. However, even though I allow dynamic adwords, I’m not interested in allowing direct advertising sales on my blog for ads I don’t get to approve. So, here’s the important bit:

    “If you’d prefer not to participate in Onsite Advertiser Sign-up, you can opt out before it starts by visiting the My Account tab.”

    Yeah… I’m a freak like that. I’m out.

     
  • erik 4:25 pm on November 9, 2005 | 3 Permalink | Reply
    Tags: blogging,

    New S60 blogs!

    The first second official Nokia blogs have launched!

    (Via http://www.blogs.s60.com/)

    [Update: Ok. So maybe The Feature was actually Nokia's first dive into the blogging scene.]

     
  • erik 3:12 pm on August 31, 2005 | 0 Permalink | Reply
    Tags: blogging

    Blog Day

    Being BlogDay, I thought I’d share some URL’s you might have missed. I decided to pick a theme: Blogs by Nokia employees. There are a lot of photo-bloggers at Nokia (which makes sense), but not too many traditional bloggers. I like to keep an eye on these though:

    • Lifeblog — Charlie Schick’s blog about “Mobile Lifestyle” and his work at Nokia.
    • MyPhoneRocks.com — Paul Whitaker, blogs about mobile tech and business, along with the application of mobility in his life (which lately means taking lots of pictures of his broken Land Cruiser with his N90 ;-)
    • christianlindholm.com — Christian Lindholm is definitely a Nokia employee to listen to. “He is the inventor of the Nokia Navi-key user interface, the father of the Series 60 user interface.”
    • anti-mega — Chris Heathcote works in the Insight and Foresight group. I first met him at ETech earlier this year, where he at Matt Jones presented on Tangible Computing.
    • Blackbeltjones — Matt Jones does “concept development and researching future mobile device user-experiences”; However, like Chris, Matt’s blog tends to be non-mobile focused.

    (Update 2005-09-08: Well, Christian *was* with Nokia. Now he’s joining Yahoo! as VP of Global Mobile Product .)

     
  • erik 5:31 pm on May 18, 2005 | 1 Permalink | Reply
    Tags: blogging,

    “Bookmark This” for WordPress

    Joshua posted a quick recipe for adding a “Bookmark This” link (using del.icio.us) to MovableType blog posts. Here’s how to do the same thing in WordPress:

    <a href="http://del.icio.us/post?url=<?php the_permalink() ?>&title=<?php the_title(); ?>">Bookmark This</a>

     
  • erik 9:41 pm on April 16, 2005 | 0 Permalink | Reply
    Tags: blogging,

    No more Kubrick, and a new plugin

    After running WordPress for a couple weeks, I decided I ought to get my head around how the whole thing works. That meant digging through the code, checking out the data-model, building a new theme, and changing some functionality. The first two were rather straight-forward. There’s a lot going on in the code, but it’s not that difficult to follow, and the database is pretty easy to grok as well.

    To build a new theme, I started with a copy of the default templates and a blank CSS file. I worked through each of the templates, tweaking a few things here and there to better match how I wanted to organize everything, then started rebuilding the layout using CSS. I’m pretty happy with it for now, although it does look a lot like my old site. The main thing I wanted to do with the new theme was to get rid of that fixed-width layout and use something that scales with the window. To help fuel the CSS layout ideas, I read through some of the examples on glish.com.

    While changing the page layout I also wanted to take a stab at tweaking a little functionality. I decided to pick something easy and change the way categories are displayed. By default, categories are dumped into your templates as list items. But instead of displaying a list, I wanted to rip off of the flickr tag display style by adjusting font size based on the amount of content behind a link. Conveniently enough, WordPress allows plugins to bind to the ‘list_cats’ method, so all it took was a simple plugin. However, like WordPress, plugins are written in PHP, which I haven’t touched in a few years… and going back to PHP from Python is painful. (It’s amazing how annoying ending lines in ‘;’ is for me now. Why not end a line with an end-of-line character? It’s going to be there anyway. And ‘$’ for variables — why? The compiler knows what’s a keyword and what isn’t.) Fortunately the documentation on php.net is top notch, so it didn’t take too long to dust off those synapses that used to think in PHP.

    In giving credit where due, and because I’m bad at coming up with project names, I named the plugin ‘flickrfy_cats’. You can view the source online to see the ugly code the caffeine told me to type, or download it for your own use.

     
  • erik 10:07 am on April 5, 2005 | 4 Permalink | Reply
    Tags: blogging

    A week on PyBlosxom… now on WordPress

    It may have actually been more then a week ago, but you may recall that I decided to take a break from my home grown blog engine and use PyBlosxom to power this site. At the same time, I also moved a couple other blogging sites to WordPress, a GPL’d system written in PHP.

    While I do enjoy how easy it is to hack on PyBlosxom, I have to say that the overall user experience with WordPress really does win. PyBlosxom is quite powerful, but it doesn’t feel finished. WordPress on the other hand, has a wiki for up-to-date documentation , simple install scripts, and content importing tools to aid moving between blog systems. It also works out-of-the-box with MarsEdit! These details matter. And you may have noticed, I’ve now dropped PyBlosxom for this site in favor of WordPress.

    So why did I drop PyBlosxom? Here’s a short list of pro’s and con’s:

    PyBlosxom PRO’s:
    – Written in Python and it’s open source.
    – It’s rather simple to hack on and extend.
    – It was pretty easy to install and get it working (if you’re comfortable in Python and the command-line.)
    – I like working with file’s on the file system (command-line tools are good.)

    PyBlosxom CON’s:
    – I don’t like the single category rule. This is almost enough to strike it from the list of viable blogging tools entirely.
    – I don’t like tying publication date to the file mod_time, and the system lacks a native way for the content author to over-ride the publish date. (NOTE: I was using a plugin to address this, but I had to run a custom script every-time I posted to the site to keep it all working.)
    – You must add a theme or write your own just to get started. (I know there’s one built in, but it’s not usable.)
    – I didn’t find a reliable “permalink” solution.
    – Scanning the *entire* file system for every request is rather inefficient.
    – No web interface for editing content. I don’t mind this for my own use, but some of the other blogger’s I host for don’t have ssh access to the server.

    WordPress PRO’s:
    – It’s open source, and I can still hack PHP.
    – I was up and running in a matter of minutes.
    – It’s got a great admin web interface.
    – The default theme is decent enough to start with.
    – the XML-RPC interfaces work out-of-the-box with MarsEdit.

    WordPress CON’s:
    – PHP apps are notorious for XSS vulnerabilities.
    – Relies on MySQL and PHP being setup correctly.

    I still have to hack on WordPress more before I’ll say that I’m comfortable with it, but so far, I’m a lot happier not having to hack the backend just to post to my blog.

     
  • erik 11:30 am on March 27, 2005 | Comments Off Permalink
    Tags: blogging,

    Going a little more smoothly now

    After a few more hours of hacking on it I think I’ve got PyBlosxom under control now. Being new to the tool I may have done a few things “wrong”, but it made sense to me. First on the list was getting my RSS and Atom feeds working. From what I’ve read, the right way to do this might be using a special plugin for these formats, but that seemed overkill. Instead, I added an RSS and Atom 0.3 flavour, which makes defining the layout really easy. Unfortunately, there’s a bit of code in the blosxom renderer that automatically encodes any content you declare as XML. I didn’t want this, so I had to comment that stuff out. While in there, I also took out the built-in RSS flavour since I didn’t want it conflicting with my own. To make sure it worked, I used the FEED Validator to check my feeds.

    Next up was getting the ModRewrite stuff working. ModRewrite is voodoo, but fortunately I’ve done a bit of it in the past. I wanted to handle a couple things with ModRewrite. First was redirecting requests for my previously static-cached rss092.xml and atom.xml to the new dynamic feeds. The rules look something like this:

    # Rewrite the static xml links instead of issuing a redirect
    RewriteRule ^atom\.xml$ somewhere/index.cgi?flav=atom [last]
    RewriteRule ^rss092\.xml$ somewhere/index.cgi?flav=rss [last]
    RewriteRule ^blog/atom\.xml$ somewhere/index.cgi?flav=atom [last]
    RewriteRule ^blog/rss092\.xml$ somewhere/index.cgi?flav=rss [last]

    With that working, I went after hiding the ‘index.cgi’ bit when browsing. There were two situations to deal with: one when a page request comes in that actually HAS the index.cgi in it; and the second when it’s missing. The two rules to do it look like this:

    # Nuke the ‘index.cgi’ part if someone asked for it
    RewriteRule ^blog/index.cgi(.*) somewhere/index.cgi$1 [last]

    # Hide the index.cgi bit
    RewriteRule ^blog/(.*) somewhere/index.cgi/$1 [last]

    The second rule makes the first look redundant, but it’s voodoo, and when all the above rules are put in the right order it works. All of these rules were defined in a .htaccess file in the root of the web documents directory. (You do have to turn the ReWrite engine on though, with the line: “RewriteEngine on”.)

    Next on the list was to block certain requests. I built a few other tools to run along side my PyBlosxom installation (which is in the “somewhere” path used above), but I wanted Authentication for some of the scripts. That was done with another .htaccess file that works sorta like this:

    AuthType Basic
    AuthName “Restricted Access”
    AuthUserFile /home/myname/blog/.htpasswd
    AuthGroupFile /home/myname/blog/.htgroups


    Require group admin

    You can tweak the FilesMatch expression to match your specific needs.

    About this time I was really wishing I wrote some test case scripts for the site to automate all the testing, but I didn’t. Even something simple using the scrape module would have been handy. But instead of doing that, I decided to play a bit more with the plugin API and wrote two to test it out. The first is a super simple random sig plugin, found here: randomsig.py. I’m using it to pull a line for my header right now.

    With the random sig working, I went on to a flickr plugin to pull my recent images into the sidebar. This was surprisingly easy, and the code is here: recentflickr.py. However, you’ll notice that the script actually fetches recent images with EVERY page request. That’s not really a good idea, so I’ve got a re-write in the works that caches images to a local directory.

     
  • erik 11:33 pm on March 26, 2005 | Comments Off Permalink
    Tags: blogging,

    wiki2html PyBlosxom preformatter

    It turned out to be super easy to convert my previous parser into a PyBlosxom plugin, so it’s working now. The source is here: wiki2html.

     
  • erik 11:01 pm on March 26, 2005 | Comments Off Permalink
    Tags: blogging,

    Moving to PyBlosxom

    We’ll see how long it lasts, but I moved all my content over to PyBlosxom today, and if you’re reading this, it’s working. I’m not a huge fan of having it build everything on-the-fly, so I may still try to get the static-rendering working, but for now it’s a pretty typical installation.

    To move the content I wrote a quick script (in Python, of course) to exported my content from MySQL and generate TXT files in a category directory structure based on the content’s previous tagging. To correct the mod-date problem I’m using the HardCodeDates plugin and generating the ‘timestamps’ file with a custom script that pulls the correct publish dates from each article’s metadata (which I saved when exporting from the database.)

    Moving my HTML templates over was rather easy, as were the RSS and Atom templates. But, the URL’s have changed a bit, which I don’t like. If I have time tomorrow I’ll dig into it a bit more to see if I can get my previous permalink scheme working. Until then the old content is still around so that links don’t break.

    I still have to re-write my text parser as a PyBlosxom plugin, but it should be a fun exercise. Since I originally wrote my text parser for a wiki, the genericwiki preformatter is working decently for now, but some of the formatting has been lost. Hopefully it’s an easy hack to plug it in. If it works I’ll post the source.

     
  • erik 3:22 pm on March 7, 2005 | Comments Off Permalink
    Tags: blogging

    never enough time

    Argg.. once again I think I’ve hit another “re-inventing the wheel” problem with the CMS system for this site. It seems like a never-ending process that goes something like this:
    (1) identify an area of the code that’s taking too much time to maintain;
    (2) decide to stop maintaining my own library for the task;
    (3) find a nice open source library to use;
    (4) branch the code and get 80% of it working on the new library;
    (5) hit a road-block working with the new library that sucks so much time it makes me want to just buy movabletype;
    (6) go ahead and fix my own library and try to mangle it back into the code;
    (7) refactor the whole darn project;
    (8) end up with the same functionality after wasting a few nights slinging code.

    The thing is, I used to enjoy writing code just for the fun of it. But lately, I’ve just been wanting things to work and I simply don’t have the free time that I used to (especially since I’ve developed the habit of doing test-driven development, which while wonderful when you have it, takes a little more time then just hacking something together.) Without being able to focus seriously on it, the CMS probably gets hacked on about eight to ten hours a month.

    For a refresher, my CMS system is all home grown (and no, it’s not open-source yet because I keep re-writing the darn thing.) It’s a multi-user/multi-site system written in Python that stores content in a MySQL database. It has it’s own web-interface for editing content, and supports most MovableType, Blogger, and MetaWeblog XML-RPC API’s. When ready to publish, the CMS generates static HTML/XML files (updating only what’s needed.)

    In general, getting and fetching content from a database is pretty simple, which is probably what makes the whole project feel overly complex sometimes. As they say though, the devil is in the details, mainly because the article handling part isn’t what sucks all the time. Instead, it’s things like template engines and article parsing libraries that do. Or sometimes it’s just a matter of exploring new ideas in tagging and article storage. For example, the article storage system has gone from flat files, to picked objects, to XML, to SQLite, to MySQL (and probably through that cycle a few times.) The templating system has gone from home grown, to Cheetah, to Myghty, and back to a new home grown tool. Most recently, I dropped all the self-written SQL for SQLObject, which seemed like a good idea at the time, but hasn’t actually boosted productivity (and still throws a few errors I don’t understand.)

    With all the evolution and new ideas going into it, the code is surprisingly getting simpler, but sadly, the “live” system is months behind the “development” version, and I have no idea when I’ll be able to merge the two. Until then, I guess I better stop blogging and get back to fixing this thing.

     
  • erik 1:16 pm on September 8, 2004 | Comments Off Permalink
    Tags: blogging

    Nokia LifeBlog and TypePad

    There’s a Nokia press release out today about an integration between Nokia Lifeblog and Six Apart’s TypePad blogging service. I haven’t played with LifeBlog longer then a quick demo, but it appears to automatically aggregate photos, videos, and messages on your phone, allowing you to browse all of them together by date. It is available in Beta for the Nokia 7610 and uses a Windows desktop application for syncing and PC browsing.

    While on the subject of mobile blogging, back in February 2004, Christian Lindholm posted that PhotoBlog is using the Atom API, but I don’t see anything on Futurice’s PhotoBlog product page about which API’s it supports.

    While I was looking for more information on Series 60 moblogging applications, I came across these two links which may be helpful for people new to the Series 60 platform:

    SymbianWiki
    Rafe’s Series 60 Freeware listing