fogbound.net




Sat, 15 Jan 2005

WordPress Publish by Email

— SjG @ 5:09 pm

So I was playing with the cool wp-mail mod by John Blade, and trying to moblog from my Treo 650 and Versamail. It works impressively.

But I’m never quite satisfied with any software — I wanted a few new features, and I wanted a fix for a weird VersaMail bug. So I added some features, and tweaked some code.

This version adds the following:

  • Allow uploaded articles to specify status (e.g., draft, publish, static, private).
  • Fixes a weird encoding issue introduced by VersaMail, which sends encoded images with a MIME type of “application/octet-stream”. Huh?
  • Creates thumbnails of the uploaded images, and includes them as links to the actual images

Status Code
To specify status for an article, you use John’s subject syntax to specify a category, then follow it up with the code for the status:

  • d – draft
  • p – publish
  • s – static
  • P – private

So, for example, to upload an article as a draft into category 6 with a title “My Article”, you would use the subject:

[6d]My Article

If you’d wanted that to be immediately published instead of posted as a draft, you could just omit the “d” in the category specifier, or explicitly add a “p”.

If you don’t know which category you want, you can still use this status hack; assign the posting to category 1, and change it later from your admin console.

Thumbnails
This functionality depends on Thomas Boetell’s popular GD lib being installed. Many PHP installations come with it prebuilt; otherwise you’ll need to bug your ISP to add it (or rebuild your PHP if you run your own server).

By default, thumbnails are created with the maximum dimension of 100 pixels; that means the longest side of the thumbnail will be 100 pixels, regardless of the aspect ratio (if your original image is 640 x 480, the thumbnail will be 100 x 75, but if your original image was 480 x 640, your thumbnail will be 75 x 100). You can change this maximum dimension; simply edit line 49, and change
$thumb_max = 100;
to the value you prefer.

Download
I’m sending my changes to John, so he can incorporate them into whatever he’s doing with wp-mail. In the meantime, you can download ’em here. Simply expand the archive, and replace your wp-mail.php with the file from the archive.

wp-mail.tgz Oooooh! A single file in a tar archive!
wp-mail.zip For those of you who prefer zip format.

Filed in:

Mon, 10 Jan 2005

Treo Sync Followup

— SjG @ 8:03 pm

Interesting, interesting. Maybe it is, in fact, a hardware problem after all.

I installed the Palm software on a Windows 2000 machine at work, tried syncing using the same cable, and it fails in the very same way.

Next test:

Try with a different sync cable (once I figure out the appropriate place to order one).

Filed in:

Sun, 9 Jan 2005

Treo 650 Sync Problem

— SjG @ 9:57 pm

Background data:
After a brief pissing match with Verizon over my slowly failing Kyocera 6035 SmartPhone, I decided to exercise my capitalist prerogative, and ended our 3+ year relationship.

Now I’m a Sprint user, equipped with a Treo 650, which is a great toy. The Treo’s clearly “one-oh” software; I have to (get to?) do a reboot once or twice a day, and there are a few obvious pointer bugs that need to be squashed (e.g., try searching for the second word in a multiple-word contact name), but I can see that with a few ROM updates, it’s gonna be an outstanding device. And hey, if I didn’t wanna live on the bleeding edge, I wouldn’t be in a room surrounded by computers at this moment.

So here’s the puzzle:

The Treo performed a perfect sync over USB the first 3 times I tried it (I’m syncing to a Powerbook G4, running Mac OS 10.3.x, and using Palm Desktop 4.2.1 Mac). Then, after the third sync, I started consistently being unable to connect to the desktop (dreaded “The Connection between your handheld computer and the desktop could not be established. Please check your setup and try again” error ).

I have tried the following to no avail:

  • Reinstall all Palm software on the Mac, then attempt sync.
  • Manually hunt down and remove all Palm software (excluding my User data). Reinstall all Palm software on the Mac, then attempt sync.
  • Manually hunt down and remove all Palm software (excluding my User data). Reinstall all Palm software when logged into the Mac as root, then attempt sync.
  • soft reset Treo, then attempt sync.
  • hard reset Treo, then attempt sync.
  • start Mac with Treo plugged in, Transport Manager enabled, Hotsync Manager not started before attempting sync.
  • start Mac with Treo plugged in, Transport Manager enabled, Hotsync Manager started before attempting sync.
  • start Mac with Treo plugged in, Transport Manager disabled, manually enable Transport Manager before attempting sync.
  • start Mac with Treo unplugged but Transport Manager enabled. . Plug in Treo, but Hotsync Manager not started before attempting sync.
  • start Mac with Treo unplugged but Transport Manager enabled. . Start Hotsync Manager, and plug in Treo before attempting sync.
  • start Mac with Treo unplugged, Transport Manager disabled, and Hotsync Manager inactive. Start Hotsync Manager, enable Transport Manager, and then plug in Treo before attempting sync.
  • With Mac running, unplug and re-plug Treo with Transport Manager enabled, then attempt sync.
  • With Mac running, unplug and re-plug Treo with Transport Manager disabled, enable Transport Manager, then attempt sync.
  • start Mac with Treo plugged into powered USB hub plugged into Mac, Transport Manager enabled, and Hotsync Manager started before attempting sync.
  • repeated all of the above tests in the other USB port.

Other Diagnostics I have tried:

  • the Treo does not show up as a USB device under System Profile.
  • USB-Probe, from Apple Developer’s kit, doesn’t see the Treo when it’s plugged in, unplugged/replugged, etc. Not that I really have any detailed idea of how USB-Probe works.
  • The hotsync cable is confirmed good (contacts tested point to point with a voltmeter)
  • The USB ports work for other USB devices.

Successes I have had:

  • I can sync via bluetooth, but only directly to the Treo, not to the SD card

Tomorrow, I will try installing Palm Desktop on a Windows machine at work, and see if I can sync (using the same cable, of course).

Most mysterious….

Filed in: