dev

May 24 23:04

iChat2Flickr update : Direct Upload Action

My last post detailed an automator action that would upload a copy of your ichat buddy icon everytime you changed it with a built in camera. Unfortunately, it had to use the mail program to send the picture to flickr by email.

But what should I find on TUAW this week but the OSX Automator Flickr Upload Action by James Pitts! So here's an updated version of the script. This will allow for easier uploads and more reliable data.

May 07 09:42

ichat2flickr automator action

ichat2flickr.gifSince I started using a Mac with a built-in iSight, I've been changing my buddy icon every morning. It's always a bit of a surprise how it comes out, because you only get 3 seconds to pose. Some of them were turning out pretty funny, and I wanted to be able to store and share them. So I wrote this automator script to upload the new picture to flickr using the email to flickr method.

The keys to this project were:

  • Buddy icons are stored in ~/Library/Images/iChat Recent Pictures/
  • Automator can create and send a mail message with an attachment
  • An Automator Workflow can be saved as a plugin, and run as a Folder Action whenever a file is added to the folder.

This script is saved as a plug-in Folder Action on the ~/Library/Images/iChat Recent Pictures/ folder. When it sees a new file added to that folder, it copies it to ~/Pictures/Flickr Selfportraits/, then changes it from a TIFF to a JPEG, then attaches it to a new email in the Mail program, then sends off the email to flickr.

Setup:

  1. Open the workflow in Automator.
  2. Customize the email details with your Flickr Upload by Email address, customize tags if desired, and choose an email account to send from.
  3. Save as a Plug-In, Plug-In for Folder Actions, Attached to Folder: ~/Library/Images/iChat Recent Pictures
  4. Change your buddy icon in Adium or iChat, and test it out!

I'd like to be able to upload to flickr directly from the automator script instead of having to use the Upload by Email function, but I haven't found anything that does that yet. I did find this Automator Action, written by Fraser Speirs which does just that, but it's not intel-friendly at the moment. Maybe I'll offer to help him update it.

Have fun, and please leave a comment if it works or doesn't work. I'm new at releasing Automator workflows.

Note:Apparently, an Automator workflow is really a folder, not a discrete file. I've zipped it up into an archive now for distribution. Drupal did NOT like trying to attach that.

Jan 08 11:19

Embedding Yahoo Maps

While working on a site (powered by drupal, of course), I came to the location page, wherein I needed to place a map. I knew I could cut-n-paste a static image of the location, then link it to either Google or Yahoo maps for further activity, but I wanted something a little more interactive. So I checked out the Yahoo! Developer Network for their maps API, and sure enough, they had lots of cool tools for embedding their map software in your code. I've been drinking the Yahoo! kool-aid ever since I signed up for free email with them 8 years ago.

I wanted an interactive map, but I didn't want to have to code up a separate flash or AJAX application and upload it. That's when I found their JS-Flash API. You call a little bit of javascript in your page, and it loads a flash application hosted by Yahoo! into a div on your page. It was perfect. All you have to do is sign up for a free Yahoo Developer Application ID.

After playing around a little bit, I was able to embed all of the code that I needed right into a drupal page, no external module coding needed. So I could put a highly interactive and customized map into the page just by putting code into drupal's web-based page creation form. No FTP, no SSH, no installing and configuring modules, just cut-n-paste into a form.

Here's the code I came up with. The important thing is that you set your input format as "PHP" because we need to use a function to put a bit of javascript in the <head> section of the page. Also, make sure you replace the appid portion with your personal AppID.

And here's what it looks like:

I thought I should wrap some of this up into a module, but when I looked, someone had already done it. I'll have to check it out.

May 09 23:18

Upgrading to Drupal 4.7 (*cross fingers*)

The Freetagging capabilities in Drupal 4.7 alone make it worth the upgrade.

Luckily I found this great video tutorial to guide me:

http://ftp.osuosl.org/pub/drupal/files/videocasts/4.7-upgrading.mov

I just need to backup first, then we'll see what happens.

UPDATE:

Well, I've made the update, and so far it's working just fine. The first thing I did was to go in and change my "tags" taxonomy to use the freetagging option. On little click, and all my current tags were magically transformed from selections from a list to a string of comma separated values. I'm free to tag away!

Now, I need to get my theme and some modules up and running again.

Apr 26 12:10

RSS Update Macro for Quartz Composer

qc_rssThe RSS feed functionality of apple's Quartz Composer development tool has a lot of potential for creating dynamically generated information, but it leaves a little to be desired if you have data that is updating quickly. Quartz Composer's RSS patch uses Safari's RSS feed functions, which only get refreshed at a minimum of every 30 minutes. I've created a Custom Macro Patch that is similar to the standard Quartz Composer RSS Feed, but adds a "Duration" input that causes the RSS Feed to refresh after the specified time.

I threw it together for an information display that needed to be updated quickly at an event. The safari update times were too long, but I noticed that If I specified a new URL for the RSS Feed module it would initiate a new download of the information. So all I needed a way to change the URL string without really changing where the RSS Feed was pointing.

So what I hacked together was a function that adds a nonsense GET variable onto the URL string called "qcfoo", and set it as the value of a counter. Every web server that I've tried it on so far will just ignore the GET variable when it receives the request, but when the counter changes, the RSS Feed is refreshed in Quartz Composer.

For example, when you feed in
"http://www.apple.com/main/rss/hotnews/hotnews.rss",
the URL string input for the RSS Feed patch really is "http://www.apple.com/main/rss/hotnews/hotnews.rss?qcfoo=1", then
"http://www.apple.com/main/rss/hotnews/hotnews.rss?qcfoo=2", then
"http://www.apple.com/main/rss/hotnews/hotnews.rss?qcfoo=3", etc.

Not very pretty, but it works. I'm open to improvements.

Note: You may need to "Right-Click, Save As" to download.