Yoz Grahame's Unresolvable Discrepancy

I came here to apologise and eat biscuits, and I'm all out of biscuits

Bob, in a cafe off Zion Square, the night before the wedding

Posted: November 24th, 2003 Comments Off on Bob, in a cafe off Zion Square, the night before the wedding

Image sent: 200311171259

Babyfitters

Pointless Things I Learned The Hard Way #2: That moving a
Greymatter blog to
MovableType is a pain
in the arse
, viagra buy unless of course the Greymatter install is broken
in some insidious way which it refuses to divulge (despite all its nice diagnostics
and repair features), website like this in which case it is such a pain in the
arse that it’s quicker to just write some code to do it.

Here is
the code.
Edit the constants, then drop it in your GM folder and
chmod it to 755. You can
run it either on the command line or via CGI (in which case you’ll
want to give it a .cgi suffix), and it will spit out a file ready to be imported into MT.
It turns out that this
is a considerably quicker method than following the MT docs.

The cause behind all this was the migration of Leslie Harpold‘s fantastic
500 project, which I heartily
recommend that you all go and enjoy now, rather than finishing this
utterly dull blog entry since she’s several orders of magnitude more
interesting a writer than I am. Existing fans may note that it looks completely
identical to how it did before, in which case I thank them because that
was the other hard part.

The hardest part of that was keeping all the inbound archive
links working. I had various ideas involving Apache redirects and the
like before realising that getting MT just to output the pages with
the same filenames as before was probably going to be easier, and it was.
To do this, I had to persuade MT to number the individual entry archives
according to the entry’s position in the blog entry sequence, so that
entry #1 in the blog would be 00000001.html, entry #2 would be
00000002.html, etc.
There’s no easy way of doing that in the base install; the
<$MTEntryID$>
tag returns the entry’s position in the MT database as a whole, and
if there are other blogs pre-existing, then the IDs won’t start from 1.

I figured there was probably a plugin out there to do this already,
and I was right: Lummox
JR’s EntryNumber plugin
. So I installed it and set the Individual
Entry Archive’s Archive
File Template value
to this:

<$MTEntryNumber zero_pad="8"$>.html

However, that didn’t quite do it, since the archive for this
blog is missing a few corrupted entries and so the numbers jump at points.
To fix this, I padded the generated export file with blank entries
and set them to Draft status after the import. Then, I made a
tweak to the EntryNumber plugin to make it include Draft entries in its
number sequence by adding the incdraft="1" attribute to the tag:

unless($count=$cache->{$entry->id}) {
    my %terms = ( blog_id => $entry->blog_id );
    $terms{author_id}=$entry->author_id if $args->{author};
    $terms{status} = MT::Entry::RELEASE() unless $args->{incdraft};

I’ve submitted these changes back to Lummox JR, so he might have
included them in the code by the time you read this and you won’t need
to make the tweak. If you’re trying to do this. Which hopefully you aren’t.

Coming up next: Something remotely relevant to anyone else, I hope…

Gilbert is funny. (And he reminded me of some of Bywater‘s old Starlight Lines engineering reports, order which I was nostalgically browsing through last night. I particularly love this one, disease
this one and
this one)

I was not “getting on” you about your spelling, diagnosis I just wasn’t 100% sure what the word “prilage” meant.

(Death wish? Me? Why on earth would you say th

I was not “getting on” you about your spelling, diagnosis I just wasn’t 100% sure what the word “prilage” meant.

(Death wish? Me? Why on earth would you say th

Image sent: 200311241302

Quinn, pilule
in a cafe off Zion Square, the night before the wedding

I was not “getting on” you about your spelling, diagnosis I just wasn’t 100% sure what the word “prilage” meant.

(Death wish? Me? Why on earth would you say th

Image sent: 200311241302

Quinn, pilule
in a cafe off Zion Square, the night before the wedding

Image sent: 200311241303

Bob, buy
in a cafe off Zion Square, the night before the wedding


Comments are closed.

Archive

The complete list of posts lives here.

yoz's bookmarks

  • How to win a grant 2013/07/22
    "Skip the long-winded argument on why your idea—your life’s work—deserves institutional support, and instead do this:"
  • Bullies Called Him Pork Chop. He Took That Pain With Him And Then Cooked It Into This. 2013/04/12
    Amazing multi-artist video for Shane Koyczan's poem about being bullied.
  • learnfun and playfun: A general technique for automating NES games 2013/04/11
    Algorithmically analysing recorded gameplay and in-memory value increments to ascertain scoring techniques. The video is fantastic and funny, and the algorithm finds some useful bugs in the games.
  • How we use Redis at Bump - Bump Dev Blog 2011/07/16
    How Redis became Bump's Swiss Army Knife to solve all kinds of data-related problems
  • Heroku | The New Heroku (Part 4 of 4): Erosion-resistance & Explicit Contracts 2011/06/29
    Fascinating description of how Heroku's recent changes are aimed at killing software erosion (or what I think of as "bitrot").
  • What are the most interesting HTML/JS/DOM/CSS hacks that most web developers don't know about? - Quora 2011/06/17
    Marvellous collection of JS, CSS & HTML hacks. Did you know you can get the browser to parse a URL or escape HTML for you, with existing JS functions? (via gnat)
  • Avatars In Motion 2011/05/21
    "This blog is to show all the beauty you can find in Second Life." Gorgeous photography of great SL locations. (via Hamlet)
  • Gabe Newell on Valve | Game development | Features by Develop 2011/05/14
    Great, inspirational interview on how they hire and organise.
  • Design @ Quora (Web2.0 Expo Presentat... by Rebekah Cox - Quora 2011/05/03
    "Great design is all the work you don't ask the people who use your products to do."
  • David Kelley on Designing Curious Employees | Fast Company 2011/04/20
    "In this interview, he explains why leaders should seek understanding rather than blind obedience, why it’s better to be a coach and a taskmaster and why you can’t teach leadership with a PowerPoint presentation."

yoz on twitter

    follow me on Twitter

    Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

    Content licensed under the Creative Commons (Attribution - Share Alike) | Theme based on Clean Room by Columbia, MO Web Design