DFLL plugin update: now supports “Press This”

The Boring Backstory

On Tuesday, I read about Justin Blanton’s Slugger+ WordPress plugin, which allows you to set your post slug by entering your desired slug enclosed in [slug] tags, e.g. [slug]this-is-my-slug[/slug]. I wondered if I could adapt my Daring Fireball Linked List plugin to do the same, i.e. if someone entered, [dfll]http://yjsoon.com[/dfll] somewhere in their post, the plugin could find the URL and set the custom field link to it.

So I tried implementing this, and I was stalled when I ran into a problem. Apart from posting it on the WP forums, I emailed Justin to see if he had any ideas. Coincidentally, he had been working on the same feature, and he’d also run into the same problem! I went off for work, and a few hours later, Justin emailed to say he’d solved the problem, and he released his CF Setter plugin the next day.

After CF Setter was released, I decided not to replicate its functionality in my plugin. (If you’d like to use that feature, go take a look — you just need some minor adjustments to get it to work with my plugin.) Instead, I thought I’d try and adapt Justin’s code to solve another problem: posting using WordPress’s built-in “Press This” bookmarklet. Shawn Blanc had put up a customised version of the bookmarklet’s code a while ago, but I was never comfortable with editing core files, what with automatic upgrades and all.

New Coolness: Link from Post Content

So, long story long, a few hours and a lot of painful regular expression writing later, the new DFLL plugin supports “Press This” by extracting the link from the first anchor tag in the post content.

Here’s how you use it: First, turn on the setting in the options page. Next, on any page you’d like to link to, just click the “Press This” bookmarklet, and the following will pop up:

Screen shot 2011 03 31 at PM 08 15 13

Click on the end of the first line, press enter (be careful not to delete the period!), and type whatever comments you’d like. The plugin will automatically grab the URL in the first line, set it to the linked_list_url custom field, and delete the entire first line for you, preserving whatever you’ve entered into the rest of the post content. Ta-da! Linked list item!

If you’d like to use this with the MarsEdit bookmarklet, you can customise the Attribution preference as follows:

Screen shot 2011 03 31 at PM 08 25 09

More details are on the DFLL plugin page, which I’ve linked to thrice already in this post. Many thanks to Justin Blanton for his plugins which both inspired and laid the foundations for this feature.

Questions and comments? Look for me on Twitter or through the contact form.

Screaming Cat

I bought a stylus for drawing on the iPad. It’s far more natural than finger-painting, and a lot less tiring. Pressure sensitivity would be nice, but I don’t miss it that much.

Essence of chicken, and mini-review of Inkpad

A first experiment with Inkpad, a vector drawing tool for the iPad. Some thoughts:

  • I’ve found drawing on the iPad (previously with ArtStudio) to be much more enjoyable than on the tablet (as in Wacom). Drawing vectors is even better, since I can easily edit my usually inaccurate finger-painted strokes. In addition, editing control points feels a lot more natural on the iPad than on the tablet (problems with pudgy fingers aside).
  • I bought the app hoping I could do my comic on it, but I might just end up going back to the tablet. My main quibbles are that I can’t (or haven’t yet figured out how to) “pick up” a path to continue drawing it, and that the interface requires a bit too much tapping for my liking. For example, some operations (join, delete, bring forward/backward) are only accessible through menus, so I end up tapping in and out of them pretty frequently. Furthermore, switching between tools just feels like a huge chore without keyboard shortcuts, but I guess that can’t be helped on this platform.
  • That said, I think the design of the app is pretty remarkable, given that I could use it to draw something without reading any instructions at all. (I also can’t find instructions now, but I could just be stupid.)

Monkeyman demands to be served

Hey! HEY! YOU! Why is my order taking so long? What do you mean, it’s not recorded? Wait, what? You don’t serve monkeys here? That’s not what your other waiter said — fine, yes, she ran off screaming, yes. But I shouted my order after her! What do you mean, no shirt, no shoes, no service?! Can you tell how much bloody effort I took to make myself look presentable with this hat?! LOOK, I EVEN BROUGHT MY OWN DAMN UTENSILS. Come on, I’m hungry, I’m willing to pay, and… hey! HEY! COME BACK HERE! Man, service here is shit.

(Done with ArtStudio on iPad.)

How to self-update Mail.app plugin compatibility

The new MacBook Pros ship with a new version of Mail.app (4.4/1082.1, vs 4.4/1082 previously). Nothing much seems to have changed except the version number, but an annoying side effect manifested when I first started the program: all my mail plugins* were deemed “incompatible” and promptly disabled.

As this wasn’t a major version update, not all my plugins had been updated for compatibility, but I figured there wouldn’t be any real compatibility issues (not ones that required re-compilation, anyway). As such, I performed some minor plumbing and restored their functionality. Your mileage may vary, but here’s how I did it:

  • In Finder, navigate to ~/Library/Mail/Bundles (Disabled).
  • Ctrl-click on a bundle, and select “Show Package Contents”.
  • Navigate to Contents, then open Info.plist with a text editor (e.g. TextEdit).
  • Near the end, look for a <key> called SupportedPluginCompatibilityUUIDs, where you’ll see a bunch of <string>s denoting compatible Mail versions.
  • For this version of Mail, just add this line right before the closing </array> tag: <string>36555EB0-53A7-4B29-9B84-6C0C6BACFC23</string>
  • (For future versions of Mail, if you’d like to try this hack, start by looking at plugins that are already compatible. In their Info.plist files, try to identify the compatibility string to paste in.)
  • Save the file, move the bundle back to ~/Library/Mail/Bundles, and start Mail.
  • WOOHOO, YOU’VE CHEATED THE SYSTEM! YOU LEET HAX0R!!! (Does anyone still say that?)

* DockStar, Mail ActOn, Letterbox and MailFollowUp.

Proof of residence

Today, I received a letter from Maybank about a credit card application I made. It said my credit card application couldn’t be completed, and asked me to send documentary “proof of residence”, i.e. a bill or a bank statement with my address indicated.

I thought about this for a second. The bank mailed a letter to my address, asking me to send something to prove that I’m staying at this same address I received their letter at. What?!

So I’ll be sending this back to them:-

Photo

I suppose I won’t be getting this card after all. Ah well.