Blog Archives

Inventing on Principle

This is a little long, but it is brilliant. Bret Victor gives a presentation that not only demos some insanely cool software development tools, but with a worthwhile underlying message. If you have the time, take a look (and make sure to hit that full screen button).

(Via Coding Horror)

 

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 [http://www.tuaw.com/|TUAW] this week but the [http://turtlehead.co.uk/macintosh-toys/osx-automator-flickr-upload-action/|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.

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 [http://flickr.com/account/uploadbyemail/|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 [http://fraserspeirs.livejournal.com/869471.html|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.

Embedding Yahoo Maps

While working on a site (powered by [http://drupal.org/|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 [http://developer.yahoo.com/|Yahoo! Developer Network] for their [http://developer.yahoo.com/maps/|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 [http://developer.yahoo.com/maps/flash/jsGettingStarted.html|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 [https://developer.yahoo.com/wsregapp/index.php|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.

<?php
drupal_set_html_head(‘

#mapContainer {
height: 400px;
width: 400px;
}
‘);
?>

// Create and display Map object at the address and with zoom level 3.
var map = new Map(“mapContainer”, “ejk_apps”,
“1201 S. Main, Ann Arbor, MI 48104″, 3);

// Add navigation and viewing tools
map.addTool( new PanTool(), true );
map.addWidget(new SatelliteControlWidget());
map.addWidget(new NavigatorWidget());

// Add the POI marker to the map and display it
marker1 = new CustomPOIMarker( ‘Michigan Stadium’, ”,
‘1201 S. Main\nAnn Arbor, MI 48104’, ‘0xFF0000’, ‘0xFFFFFF’);
map.addMarkerByAddress( marker1, “1201 S. Main, Ann Arbor, MI 48104”);

And here’s what it looks like:

<?php
drupal_set_html_head('

#mapContainer {
height: 400px;
width: 400px;
}
‘);
?>

// Create and display Map object at the address and with zoom level 3.
var map = new Map(“mapContainer”, “ejk_apps”,
“1201 S. Main, Ann Arbor, MI 48104″, 3);

// Add navigation and viewing tools
map.addTool( new PanTool(), true );
map.addWidget(new SatelliteControlWidget());
map.addWidget(new NavigatorWidget());

// Add the POI marker to the map and display it
marker1 = new CustomPOIMarker( ‘Michigan Stadium’, ”,
‘1201 S. Main\nAnn Arbor, MI 48104’, ‘0xFF0000’, ‘0xFFFFFF’);
map.addMarkerByAddress( marker1, “1201 S. Main, Ann Arbor, MI 48104”);

I thought I should wrap some of this up into a module, but when I looked, [http://drupal.org/project/ymap|someone had already done it]. I’ll have to check it out.

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.

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&#8221;,
the URL string input for the RSS Feed patch really is “http://www.apple.com/main/rss/hotnews/hotnews.rss?qcfoo=1&#8221;, then
http://www.apple.com/main/rss/hotnews/hotnews.rss?qcfoo=2&#8221;, then
http://www.apple.com/main/rss/hotnews/hotnews.rss?qcfoo=3&#8221;, etc.

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

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

AADL Pittsfield Branch Screen Saver

Movie #1 – Welcome Screen (mp4) :: Movie #2 – Book Display (mp4) :: Download

greetsfield_welcome

About:
Based on the foundation of the aadl_saver (below), I created a new screen saver to welcome patrons to the new Pittsfield Branch. It contains a welcome screen, listing of events, and multiple dynamic displays of New or Top Books (including cover images) from the AADL RSS feeds. Bonus geek points to anyone that can identify the application which influenced the overall look.

Requirements:
Apple Macintosh running OS X

Installation instructions:
Place the .qtz file in ~/Library/Screen Savers (just for you) or /Library/Screen Savers (for everyone)

Configuration options:
Note: In order to make screen saver option changes “stick”, click off the edited field before clicking “OK”
Feeds = The String containing all the Feeds you want the Screen Saver to display. Screens are Separated by the ‘^’ character, and Displayed Titles are separated from the URLs by the ‘;’ character. The first two Screens should remain hard-coded to “Welcome” and “Events”.

Seconds per Title = Number of seconds that each title will be displayed on the screen

greetsfield_books

Coding:
If you’re interested, you can open the screen saver using [w:Quartz Composer]. You’ll see all the fun I had figuring out exactly how to make those cover image thumbnails slide across the screen.

AADL Books RSS Screen Saver

Download

aadl_saver1

About:
A dynamic display of New or Top Books (including cover images) from the AADL RSS feeds. Currently only displays books, as the other items don’t have good cover images (yet). Best of all, the information comes from the AADL RSS feeds, meaning it’s always up to date!

Requirements:
Apple Macintosh running OS X

Installation instructions:
Place the .qtz file in ~/Library/Screen Savers (just for you) or /Library/Screen Savers (for everyone)

Configuration options:
Note: In order to make screen saver option changes “stick”, click off the edited field before clicking “OK”
Seconds per Title = Number of seconds that each title will be displayed on the screen
Titles to Display = Total number of titles to grab from the RSS feed (larger lists take longer to download)
Sub (blank = Top) = Subject search for new books (some good examples are “cookery” or “knitting”)– it you leave it blank, the screen saver will display the current Top Books.
Any AADL RSS Feed = Cut and paste the RSS feed address from any RSS icon you see around the site. Even works with your holds and checkouts! The other options are ignored if this field is not blank.

Coding:
If you’re interested, you can open the screen saver using [w:Quartz Composer]. It looks a little intimidating at first, but it’s the most fun I’ve had coding.
aadl_saver_overview