battis.net and I'm all out of bubble gum…

As noted earlier, there is a slick trick for taking a publicly accessible calendar in FirstClass and generating an iCalendar feed. Also noted earlier, the big problem with this feed is that it doesn’t contain timezone information, which makes some calendar systems (most notably Google Calendar) assume that everything is happening at Greenwich Mean Time. Which it usually isn’t. And I have written a PHP script that adds Pacific Timezone information to the iCalendar feed.

Let’s put all this together and take a current FirstClass calendar, make it readable from the web, feed it through the script and then add the result to your calendar program of choice.

  1. Right-click (or control-click, on a Mac) on the calendar in question and Add to Desktop. A second calendar icon will appear, possibly named with the name of whoever’s calendar it is. Possibly not. FirstClass is a mystery.
  2. Drag the new calendar into your Web Publishing folder (on some versions, Web Publishing may be called Home Page Folder — why is this? FirstClass is a mystery.)
  3. At this point you’re faced with a choice: either blithely disregard security, rely on security through obscurity, or be ready to generate a somewhat more aggravating URL to be more (but still not fully) secure.
    1. Disregard security: leave the calendar named whatever it’s currently named. You need to change the permissions (right-click/control-click and choose Permissions) so that All Users has Schedule+Details permissions on the calendar. This will change permissions for not just the copy in the Web Publishing folder, but also for the original calendar — since the “copy” in Web Publishing is just an alias to the original anyway.
    2. Security through obscurity: rename the calendar something else (I usually do this, and use a password generating application to give me a random collection of letters and numbers — e.g. a2612GhxU). Change permissions as described in 3(a) above.
    3. Better security: follow the directions here for generating your URL. Don’t tinker with permissions.
  4. Point a web browser at calendar in your Web Publishing folder, add the iCalendar feed get parameters, and copy that new URL to the clipboard.
  5. Point your web browser your copy of the time zone script and paste the URL you just copied into the Calendar URL field and click Generate.
  6. Copy the new URL that appears below. You can paste that URL into whatever calendaring system you want (that can subscribe to iCalendar feeds).
    1. In Google Calendar, you would Add a new calendar by URL and paste in your URL. (caveat: Google doesn’t seem to be too fantastic about actually updating iCalendar feeds — they allege that this is a sporadic issue, but I have experienced it as more prevalent than sporadic).
    2. In iCal, you would choose Subscribe… from the Calendar menu and paste in your URL.
    3. You could also paste this URL (via some contortions — e.g. email it to yourself and copy-paste from that) into a phone calendar app.

June 14th, 2011

Posted In: How To

Tags: , , , , , ,

This is really just a quick hack: all it does is insert the correct timezone description in the header of an iCalendar feed. But if the server that is generating the iCalendar feed doesn’t do it, someone has to. The script generates a URL that can then be subscribed to by your Calendar reader of choice. (I’m running this on my server and using it daily to good effect, but decline to share bandwidth with the world for this one):

$filename = "calendar";
 
if (isset($_GET["url"]))
{
	$url = $_GET["url"];
 
	if (!isset($_GET["show_url"]))
	{
		preg_match("|.+\/([^?]+)\??|", $url, $matches);
		if (isset ($matches[1]))
		{
			$filename = $matches[1];
		}
 
		$calendar = file_get_contents ($url);
 
		if ($calendar)
		{
 
			//$output = preg_replace_callback ("/(DATE-TIME:)(\d{4,4})(\d{2,2})(\d{2,2})T(\d{2,2})(\d{2,2})(\d{2,2})[^Z]/", "adjustTimeZone", $calendar);
 
			$timezone = "X-WR-TIMEZONE:America/Los_Angeles\n" .
				"CALSCALE:GREGORIAN\n" .
				"BEGIN:VTIMEZONE\n" .
				"TZID:America/Los_Angeles\n" .
				"BEGIN:DAYLIGHT\n" .
				"TZOFFSETFROM:-0800\n" .
				"RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU\n" .
				"DTSTART:20070311T020000\n" .
				"TZNAME:PDT\n" .
				"TZOFFSETTO:-0700\n" .
				"END:DAYLIGHT\n" .
				"BEGIN:STANDARD\n" .
				"TZOFFSETFROM:-0700\n" .
				"RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU\n" .
				"DTSTART:20071104T020000\n" .
				"TZNAME:PST\n" .
				"TZOFFSETTO:-0800\n" .
				"END:STANDARD\n" .
				"END:VTIMEZONE\n";
 
			$loc = strpos($calendar, "BEGIN:VEVENT");
 
			$output = substr($calendar, 0, $loc) . $timezone . substr($calendar, $loc, strlen($calendar));
 
		    header("Content-Type: text/calendar");
		    header("Content-Disposition: inline; filename=$filename-pacific-timezone.ics");
			echo $output;
			exit;
		}
	}
}
<h1>vCalendar Time Zone timezone</h1>
	<p>This is quick script to "de-float" calendars in the vCalendar format which do not specify time zones for their events. This script will automatically add the Pacific time zone information to the calendar at the URL entered below. Copy-and-paste the resulting URL below into your calendar reader of choice. <a href="http://battis.net/link/timezonescript">The source of this script is freely available.</a></p>
	<form action="<?= $_SERVER["PHP_SELF"] ?>" method="get">
		<input type="hidden" name="show_url" value="" />
		<p>Calendar URL <input name="url" type="text" value="<?= $url ?/>" /></p>
		< ?php
				$newUrl = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"] . "?url=" . urlencode($url);
				echo "<p><a href=\"$newUrl\">$newUrl</a>";
		?>
		<p><input type="submit" value="Generate"/></p>
	</form>

February 14th, 2011

Posted In: How To

Tags: , , ,

One, largely undocumented, trick that I have discovered is that, if one places a calendar where it is accessible from the web, say:

http://www.mchschool.org/~sbattis/1to1workshops1011

that one can then cause FirstClass to generate an iCalendar feed for that calendar by appending the following GET parameters to the URL:

http://www.mchschool.org/~sbattis/1to1workshops1011?plugin=ical&leaves

Clicking this link will either download an iCalendar file or offer to subscribe you to this calendar, depending on your browser settings — right-clicking will allow you to copy-and-paste this link into your Calendar reader’s subscription settings. In fact, with some tinkering, it turns out that the calendar can be in a secured directory and the username and password can be sent through as part of the URL (in a format that I thought I had seen the last of with the decline of Gopher servers):

http://sbattis:supersekretpassword@www.mschschool.org/~sbattis/1to1workshops1011?plugin=ical&leaves

(Nota bene: the above username and password are fake and won’t work — thereby rendering the link inoperable. But you get the idea.)

February 14th, 2011

Posted In: How To

Tags: , , , ,

For the last couple of months, one of my high school classes at Jewish Day School has been working on building an interactive tool about the Six Day War for a middle school curriculum unit. They have put a lot of work into researching their data and laying it out in Google Earth, and now we’re putting together a tour of the data for the middle school students, that will also teach them a little about how to use Google Earth. It’s been enormously fun.

But. But, we now have to do some programming or some very careful recording in Google Earth to create this tour (a là Al Gore’s Climate Change tours). And my students are far more interested in the design end of things than in the coding end of things. They’re great at what they do, but niggling coding details give them head aches.

So I built a Google Docs spreadsheet, into which they can plug various pertinent information and out of which comes valid KML instructions that will define the tour. I’m a little proud of this — I don’t think that there’s anything else quite like it out there. There are three kinds of information that need to be entered:

  1. SoundCue — any audio that should be played in the background. You can either enter the whole URL to the MP3 file that should be played, or just the file name (and make sure that you enter the path in which all the files can be found on the KML Generator tab). You also need to tell us both when the cue should be played and how long it should last.
  2. AnimatedUpdate — anything that should be happening in Google Earth in terms of showing photo overlays or placemarks or polygons or what-have-you. Enter what should happen, and when (and, if relevant, for how long).
  3. FlyTo — any time we change where (or when) we’re looking at Google Earth. Enter when and how long the transition should take, and the date (and time) that we’re meant to be looking at.

The AnimatedUpdate and the FlyTo also expect the user to enter KML code — which can be copy-and-pasted from Google Earth KML exports for each transition. Happily, if something needs to happen more than once, entering the KML for the first instance will automatically populate future instances. In addition, the pauses necessary to synch up all of the action are calculated by the spreadsheet.

Update March 25, 2011: The spreadsheet above is our live work (since I kept updating the spreadsheet after this post).

The end result is both a visual timeline of the tour (helpful for debugging any weird errors) and also KML code that can be copy-and-pasted out of Google Docs and into a KML file. (Caveat emptor: depending on what you’re pasting the KML into — I like Xmplify — you may see that there is a leading and trailing quote that need to be manually deleted.)

Right now the spreadsheet can handle tours up to four minutes and 10 seconds in length (250 seconds, for those of you keeping score at home). This is because I was originally copying the KML out of the KML Orderer worksheet, and Google Docs supports pasting of up to 1000 rows in total. You’ll see that the current KML worksheet is a single cell, getting around this limitation, but I didn’t bother to extend any of the other worksheets. Just make sure you fill down all the formulas if you extend any of the sheets!

Here’s a link to a scratch copy of the spreadsheet. Feel free to copy and use it for your own purposes — let me know how you used it!

February 12th, 2011

Posted In: Educational Technology, How To, Social Media, Useful Tools

Tags: , , , , , ,

So… the RSS embed plugin for our school wiki server has been broken since before school started, with no sign of a fix in sight (other things are taking higher priority). Of course, since I have zero desire to post each new training video to our school video as I make them, this is a bit of a stumbling block. But…

I slapped together a script that makes use of the Magpie RSS framework to render some (most?) RSS feeds as a simple HTML page, which I can then embed as an IFRAME in our school wiki. Et voilá, no more having to paste in individual links! You can give it a whirl yourself: paste an RSS feed into this form:

RSS feed:

Obviously, if you have need of this on a regular basis, I would be happy to share the code — don’t just run it off my poor little web server!

November 22nd, 2010

Posted In: How To

Tags: , , ,

A few days ago (well, maybe a couple weeks ago), I was chatting with one of my colleagues about how I go about testing out new plugins and themes for WordPress µ before loading them on our school blog server. It seems like documenting my process might be generally helpful, so…

To start with, I decided (after ten years of mucking out Apache config files and PHP extensions and custom MySQL installs — thank you so, so much Marc Liyange for your timely and helpful installers!), that I was a grown-up and could spend $60 on a tool that makes my life easier: I run MAMP Pro on my MacBook. This means that I have a generic Apache/PHP/MySQL stack that supports commonly-used PHP extensions, Apache configurations, etc. I have redirected the document root of my install to my regular user’s Sites directory in OS X (~/Sites) so that I have ready access to the backend files of for my test installs. The net result: WordPress’ famous “Five Minute Install” is now true of almost any LAMP-based web application — I had a five-minute install of Drupal, Moodle, Joomla… you name it.

I’ve also settled into using Coda ($99) to edit HTML/PHP source code, since I particularly like the built-in terminal and publishing management features.

With WordPress µ installed (which, I guess, is now calling itself WPMU or WordPress MU or even WordPress 3 in betas), I now do the following:

  • I install create a new blog for each new theme or plugin that I want to test out. I follow a pretty intuitive naming scheme: the URL for the blog is the URL for the plugin or theme, and the name of the blog is the name of the plugin or theme (so WordPress Hashcash is at …/wp-hashcash and named WordPress Hashcash).
  • As I create each new blog, I create a new user to be that blog’s administrator. I almost never use this login, but it means that I have one user who is matched to each blog. In doing this, I make heavy use of Gmail’s + modifiers, so new user emails look like mygmailaddress+talyn+wpmu+blogurl@gmail.com — this lets me catch and filter relevant emails easily on the other end. (I developed this system when I was testing plugins that sent email notifications). For the curious, Talyn is the name of my laptop (so I know which server is sending me email) and WPMU is the keyword to distinguish these emails from, say, Drupal notifications.
  • I also have six generic users that I add to most (not all — I add them as needed) blogs, each with their own standard privileges:
    • Anna “Annie” Administrator
    • Edward “Eddie” Editor
    • Allison “Allie” Author
    • Christine “Chrissy” Contributor
    • Samuel “Sammy” Subscriber
    • Nathan “Nate” No Privileges

    I actually included nicknames so that I could control for how different themes displayed usernames (since I’m thinking about FERPA and how it may apply to our students on our school blogserver).

  • I have one blog on which I never activate themes or plugins, which I lyrically call “Is this blog in the blast radius?” This is based on my experience installing Digress.it on WordPress µ at the start of the year (it hosed every blog on the server, rather than just the one where it was activated). I check this before I deem any test complete.
  • One tricky thing that I did was that I set up MAMP to run Apache and MySQL as my local user account on my MacBook, and I have set permissions on my Sites directory so that my local user has all privileges, as does the www group, and other users have read/execute privileges (chown -R seth ~/Sites; chgrp -R www ~/Sites; chmod -R 775 ~/Sites). This means that I usually don’t run into problems with web apps that want to move or create files. This is also, of course, totally insecure. Que sera, sera.
  • I have an extra blog set up on my WordPress µ install that runs Feed WordPress, and it republishes the feeds for all of the other blogs on the server tagged Note. This means that I can post something tagged Note to any blog that I’m working on and then have all my notes together in one place. Adding the subscriptions to the Feed WordPress blog is a manual step, but not prohibitively difficult. And it really does mean that I have one place for all of my notes on how things went (or didn’t went) in my WordPress µ testing. I have the feeds categorized as Plugins, Themes, Configuration and Hacks, since those are generally what I’m testing (and mostly Plugins, at that).
  • One hitch in my system is that I have opted to keep my system entirely up-to-date (I’m running WordPress µ 2.9.2 with the most recent versions of all my plugins), while our school blog server is still at 2.8.4a. Generally speaking, this hasn’t been much of a problem, but when I’m particularly concerned, I will sometimes check things out on a lingering 2.8.4a install before loading it.

May 18th, 2010

Posted In: How To

Tags: , , , , , , , , , ,

Since this is available nowhere else on the internet, I’m posting it here for safekeeping. I believe that this applies to at least FirstClass 10, perhaps also FirstClass 9 (but that’s just a W.A.G.). This is from FirstClass tech support:

An RSS feed can be generated for any FirstClass container object (folder, conference, etc.) which is visible to the Web by adding a template override parameter to the URL. In other words, if the URL to the news conference on your Web site was http://www.mysite.com/News , then the URL to the RSS feed for that conference would be http://www.mysite.com/News?Templates=RSS&items . If you have an RSS feed reader you can simply enter that URL, give it a name, and you’ll have a feed. Usually, sites that offer an RSS feed will put a little icon on their main Web page to show that they have one. If your main page is a FirstClass document all you need to do is:

  1. Paste in your preferred RSS image
  2. Highlight the image in the editor and right-click your mouse, choose “Make Link”
  3. Enter the RSS feed URL, in our example http://www.mysite.com/News?Templates=RSS&items or ?plugin=RSS&Items

Buyer beware: I have not seen this work yet in my own tinkering. But I am hopeful that somehow I’m doing something wrong.

May 18th, 2010

Posted In: How To

Tags: , ,

I just slapped together a very quick plugin for a teacher’s blog that adds a [category] shortcode to WordPress. Basically, it just passes through all of the attributes of the shortcode as parameters to wp_list_categories(), allowing the user to embed a list of blog categories in any page, post or widget. This feels like something that should already exist (but I couldn’t find it).

category_shortcode.php

April 23rd, 2010

Posted In: Blogs, How To

Tags: , , , , ,

The tough thing about best practices is remembering to practice them: a while back I started to collect my screencasts on particular topics into one, easy-to-remember link (e.g. iMovie ’09 information is at http://battis.net/link/imovie09). I spent a while uploading my Flash tutorials to one of my class conferences the other day, forgetting to just create the simple link (and thereby limit repetitive work). So, with that in mind…

Here are a few tutorials on animation (at a basic level) in Flash 8 Professional. They need to be re-recorded and cleaned up a little, but they’re a useful starting place for someone totally at a loss when faced with Flash’s ridiculous learning curve. The link to this post and to anything else I might have to say about Flash is http://battis.net/link/flash8

The videos in this sequence are (with links to higher-quality, but less-firewall-friendly, Screencast-O-Matic videos):

  1. Create a Simple Animation — How to create a simple Flash Professional 8 animation using a Motion Tween between two keyframes.
  2. Adding Complexity to a Motion Tween — How to use rotation (or scale, skew or other Transformations) to adjust a simple animation.
  3. Adding a Motion Guide — How to add a Motion Guide layer to a simple animation in Flash Professional 8.
  4. Shape Tweens — How to use Shape Tweens to animate motion (or, well, shapes) in Flash Professional 8.
  5. Reverse Exploding Animation — How to have a scattered group of shapes “resolve” themselves into your design in Flash Professional 8 (this was a request from my media design class).

February 26th, 2010

Posted In: Educational Technology, How To

Tags: , , , , ,

« Previous PageNext Page »
css.php