Help with trackback.py and autoping

Other PyBlosxomers have been nice enough to listen to my various gripes about plug-ins and extras, and to lend a hand (thanks guys: that was quick).

Ted Leung rolled in the various changes to trackback.py that I'd accumulated from various other hackers. If you use trackbacks in your pyBlosxom install, get the latest from ted's site. Looks as if he also has an updated version of commentAPI.py, so I copped that. He added a plug-in, xmlrpc_pingback.py, but I wasn't sure precisely what it did since it didn't have the standard plug-in doc header. I may pore through the code when I get a chance.

Eric Gaumer put a lot of work into the autoping plugin. He hasn't released his patched version, but I'll look out for it soon. He tried to use it to ping back my site, but apparently my trackback/pingback RDF was wrong. I think I've fixed it. If you try to ping Copia through a comment URL and it fails again, please let me know.

[Uche Ogbuji]

via Copia

Using post date for PyBlosxom file hierarchy

download customized xmlrpc_blogger.py
download patch to xmlrpc_blogger.py

Most PyBlosxom tools seem to like the pattern of piling all blog entry files into the top-level datadir, or using at most one level of hierarchy in the form of simple categories. Yuck. Here is an example of resulting ugliness: I like to post entries entitled Quotidie every day. It used to be in Copia that the first one gets lumped into top-level as Quotidie.txt. When I post the next one using BloGTK, the XML-RPC back end would detect a filename clash and choose an alternate file name such as Quotidie5gJS68ade.txt. It would be nice if it could pick a prettier means for disambiguation (e.g. Quotidie.txt). I understand this wouldn't be all that easy to do because of problems with race conditions, but of course, it would be nice if such clashes were just extremely rare in the first place.

IMO The obvious way to do this is to use the date for disambiguation. I'm sure others have done such things (there is at least one plug-in I've seen that uses an embedded date in the filename to preserve the posting date), but I couldn't find very much about this idea on the Net. I ended up just looking into what it would take to hack something for Copia. The goal is to have each entry in a hierarchy according to date so that yesterday's Quotidie would be found in:

$datadir/2005/04/07/Quotidie.txt

and today's in

$datadir/2005/04/08/Quotidie.txt

I use keywords rather than categories for PyBlosxom, so the directory structure has no semantic meaning for purposes of Copia. Since I usually post through blogging tools over xml-rpc, it turned out that it was enough to patch xmlrpc_blogger.py. While working on this plug-in I recoiled at how the file naming code is thrown carelessly into the body of the newPost function. I broke that functionality out into a new function blog_document_name, which returns the name of the file for the blog entry. This makes it easier for people to hack their own naming algorithms. My specialization implements the date-based hierarchy described above.

It seems there is still some work to be done. For one thing BloGTK doesn't seem to be able to find the files within this hierarchy when looking for postings to edit or delete. For another, PyBlosxom seems to get confused because permalinks to entries within the date-based hierarchy pulls in other entries as well as the intended one. I guess I have to learn more about how PyBlosxom manages its $datadir.

Update: I figured out this problem. PyBlosxom looks for discrete dates and years in the request URL, in order to handle requests for "all entries on day D". Turns out that a URL component of the form "20050408" doesn't trip this algorithm, so I just went with a structure of the form:

$datadir/20050408/Quotidie.txt

See the top of this post for links to to my custom xmlrpc_blogger.py and a patch from the xmlrpc_blogger.py shipped in the PyBlosxom contrib-1.2 package. I hope it helps someone else.

[Uche Ogbuji]

via Copia

Quotidie

         If you came this way,
Taking any route, starting from anywhere,
At any time or at any season,
It would always be the same: you would have to put off
Sense and notion. You are not here to verify,
Instruct yourself, or inform curiosity
Or carry report. You are here to kneel
Where prayer has been valid. And prayer is more
Than an order of words, the conscious occupation
Of the praying mind, or the sound of the voice praying.
And what the dead had no speech for, when living,
They can tell you, being dead: the communication
Of the dead is tongued with fire beyond the language of the living.

-- T.S. Eliot -- "Little Gidding"

"Little Gidding" is the brilliant jewel of the ponderous Four Quartets. So much so that Eliot had to issue instructions barring anyone from reproducing "Little Gidding" outside the context of the entire Four Quartets (I wonder what the RDF would look like to express that in some extension of the Creative Common licensing). It used to be the longest poem I had entirely off head, and I still have a good portion of it (I sometimes recite the "Ash on an old man's sleeve" lyric to Osi at bed time).

When I once recited the passage including the above quote at Nsukka's great Anthill Club, some in the audience figured I was a religious fundamentalist of some sort, come to preach. Of course Eliot meant Christian prayer (specifically Anglo-protestant prayer--"No bleedin' 'Ail Marys"), but his expression transcends all that. The words are amazingly apt when held up to indigenous Igbo religion/cosmology, with which I've always been fascinated, but just to be clear, have never practiced (lapsed Catholic Dad, Charismatic Evangelical Mom). Even if you're agnostic, as I am, the words are still a powerful expression of the awe that that certain places carry for us, whether in a natural or a preternatural sense.

[Uche Ogbuji]

via Copia

Keywords on Copia

We started out by using PyBlosxom's categories here on Copia, but they were clearly never going to quite cut it. We needed multiple categories. Thankfully I found Bill Mill's keywords plugin (this is probably a more permanent link). It's one of the few PyBlosxom modules I haven't had to hack to get working. I did have to spelunk in his code to figure out that the $keywords story template variable has all the keywords for a specific story: this part was not documented in the doc string of the plug-in (it mentions the $all_keywords variable, which is more useful in other templates in a flavor).

[Uche Ogbuji]

via Copia

Quotidie

And then he turned his power on and the ground began to move
And all the buildings for miles around were swaying to the groove
And just when he had fooled the crowd and swore he wouldn't fight
We rocked his beat with a 12 inch cut called Disco Kryptonite

-- Cozmo D of Newcleus -- "Jam on it"

I've had old-school hip-hop in my head lately. T La Rock's "It's yours", UTFO's "Roxanne, Roxanne" and "Bad Luck Barry", Kurtis Blow's "Basketball", and of course all sorts of stuff from Grandmaster Caz, The Trecherous Three, Afrika Bambaata and Grand Master Flash and the Furious Five. It's just been coming into my head unbidden. And when I think of the great classic "Jam on it", I get the most powerful memories of illegally jumping the fence at my boarding school with a few of my fellow hip-hop nerd friends and walking to Okigwe town to loiter about the local record shops. We'd ask the owner to play the Wiki Wiki Wiki song over and over. Serious psychedelic cosmic slop. I was too young (12 or 13) for it to have occurred to me that those dudes must have been on some heavy grass when they wrote that.

And by the way, I love the way that the French group Saïan Supa Crew (French hip hop is killing it right now, f'real) take on Newcleus's touch of a dude interjecting comic relief in a helium gassed up voice.

[Uche Ogbuji]

via Copia

Getting autoping to work in pyblosxom

Man. PyBlosxom is mad sweet, but it takes a lot of hacking to get it properly tricked out. Just when I got trackback working here on Copia, I decided to try autoping.py a shot, and it broke into several pieces as soon as I tried to use it. I fixed the first, second and third traceback before giving up. Clearly it needs even more work than trackback.py did, and I'm still limited by PyBlosxom newbeing.

Good thing DJ Revolution is playing right now. Keeps me in a Colorado Kind mood no matter what. I guess I know what some people feel like when they make their first foray into 4Suite. Well, I guess I've always known.

[Uche Ogbuji]

via Copia

Getting trackbacks to work in pyblosxom

Ted Leung's trackback.py module for pyblosxom is pretty badly broken. Hard to imagine it ever worked at all, but I had to have another full immersion into PyBlosxom plug-in land to try to figure fix it. I got some ways by myself beefore I went to seek help on the 'Net and found Eric Gaumer 's message and blog entry with some of the fixes I'd figured out, and some others. I also found some improvements from Steven Armstrong. In a similar thread, I learned from Joseph Reagle about this useful Web page for sending trackback pings.

Ted Leung seemed receptive to the fixes and said he had an update version of trackback.py, but I couldn't find it, so I just made the changes myself. I've posted the updated file here (trackback.py), in case anyone wants it. I'll probably remove the file once I see a fixed version in the spot pointed to by the PyBlosxom registry.

BTW, Eric's a fellow snowboarder, and he's scored a trip to the Mammoth this year. Sweet. I wonder how many other Pythonistas shred.

[Uche Ogbuji]

via Copia

PyMarkdown for PyBlosxom

download

The PyBlosxom plug-in registry lists pymarkdown.py, by Tollef Fog Heen as a PyBlosxom plug-in. Odd thing is that the downloaded file seems to implement Markdown just fine, but not the PyBloxsom plug-in API.

So I hacked up this script that does so. It's basically http://err.no/pymarkdown/pymarkdown.py with the PyBlosxom plug-in stuff implemented. I'm truly a Blosxom newbie and I just did a cut&paste+hack from other plug-ins I saw, but it seems to work for my blog.

[Uche Ogbuji]

via Copia