Transmogrifying those Google Reader JSON dumps into something useful

For the last few years (my JSON feed tells me: since 2008), I have been tagging and annotating articles of interest as they passed before my eyes in Google Reader. This served a two-fold purpose:

  1. I could find them again later, easily, because they were tagged and annotated.
  2. I could share an RSS feed with those annotations to particular interest groups that I worked with (e.g. anything tagged “for robotics” would show up on my advanced computer science class’ portal page, or anything tagged “for academic computing” would show up on my school home page).

This was a great way to share (and manage) resources. Granted, much of what passed before my eyes in Google Reader was trivial and not of lasting value, but this filtering allowed me to hang on to at least a few gems for future reference.

And then Google Reader got the Google+ treatment and sharing items broke. But you could download a JSON dump of all the items that you had ever shared. It wasn’t entirely clear what you could do with this JSON dump, but… there it was. And then: I realized that all of my other information is stashed on my web server (and that I have become increasingly distrustful of relying on cloud services to maintain my data and workflows — e.g. my weekly backup of all my Google Docs… just in case).

Wouldn’t it be handy to import that JSON feed into a new blog on my server? So I wrote a PHP script that converts (at least my) Google Reader JSON dump into an XML file that WordPress can import as a list of posts. With the tags and annotations converted over. In fact, with all of the data in the JSON dump embedded in the XML file (although WordPress doesn’t read all of it).

This comes with a few caveats:

  • For items that came from blogs with a full feed, the result is a republication of the original post — which feels ethically dubious to me. (I have made my new blog of Google Reader shared items private, so that I have the data but I’m not sharing it with the world).
  • I’ve made guesses as to how to treat some of Google’s data. Reasoned, educated guesses, but guesses nonetheless. For example, I’m not super-clear on which dates in the file correspond with what events — does a publication date refer to when the item was shared or the original post was posted?
  • I’ve added in some arbitrary (and therefore, ideally, eventually, configurable) WordPress tags to make the import go more smoothly. Where I have done that, I mark it in the script as a TODO item. (And, in truth, I didn’t really test to see if all of these items were necessary.)
  • The original authors of the posts are transfered to the XML file, which means that when the actual import into WordPress is done, you will have the option to either laboriously create a new user for each distinct author or simply revert authorship to the currently logged-in WordPress user. It doesn’t seem like WordPress has a format for exporting or importing users (or, at least, my cursory search didn’t find it). Clearly an ancillary SQL query could be generated that pre-populated the WordPress database with the users that the XML file refers to. But I haven’t bothered to do that.
  • You’ll need your own PHP-compatible webserver to run the script, since I have been quick and dirty and simply imported the JSON file from and exported the XML file to the script’s local directory. And I have no interest in setting up my world-facing webserver to take the traffic hit of processing other people’s multi-megabyte JSON dumps.
With that said, here is the script, as it stands this morning.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/**********************************************************************
 * Google Reader to Wordpress
 *
 * 2011-11-27
 * Seth Battis (seth@battis.net)
 * 
 * This script takes the output of Google Reader's JSON export of
 * shared items and converts it into an XML file that can be imported
 * into a Wordpress blog as posts. All of the data in the original JSON
 * file is preserved in the XML file, either by transfering it to
 * an appropriate format (e.g. Google Reader categories are converted
 * to WordPress post tags) or simply as an additional XML tag (e.g. the
 * Google Reader commentInfo metadata for recent shared items). In
 * situations where actual data has to be converted to make it readable
 * for WordPress, the original data is included as the JSON attribute
 * of that tag (e.g. timestamps and categories).
 *
 * As currently written, the script looks in its local directory for
 * Google Reader "shared-items.json" file and generates a matching
 * "shared-items.xml" file, also in its local directory.
 *
 * There are a number of potentially configurable (i.e. arbitrary)
 * values marked as TODO.
 *
 * Caveat emptor: this has been tested against my ~1000 item Google
 * Reader shared items feed and on my WordPress 3.2.1 site. I would
 * presume that it should work fairly well for others, but make no
 * guarantees!
 *********************************************************************/
 
/* returns a Wordpress slug-version of the given text (only
   alphanumeric characters and dashes) */
function sluggify($text)
{
	return preg_replace("|[^a-z0-9]+|", "-", strtolower($text));
}
 
/* SimpleXML doesn't really support namespaces unless you force it */
$xml = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
	xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:wp="http://wordpress.org/export/1.1/"
></rss>';
$rss = new SimpleXMLElement($xml);
$namespaces = $rss->getDocNamespaces(true);
 
/* load the Google Reader JSON file */
$file = file_get_contents("shared-items.json");
$json = json_decode($file, true);
 
/* Wordpress will choke if our post names aren't unique, so we track
   them separately */
$post_names = array();
 
/* header information describing the file itself */
$channel = $rss->addChild("channel");
$channel->addAttribute("direction", $json["direction"]);
$channel->addAttribute("id", $json["id"]);
$channel->addAttribute("self", $json["self"][0]["href"]);
$channel->addAttribute("author", $json["author"]);
$channel->addChild("title", $json["title"]);
$channel->addChild("link");
$channel->addChild("description");
$pubDate = $channel->addChild("pubDate", gmdate("D, j M Y G:i:s O", $json["updated"]));
$pubDate->addAttribute("json", $json["updated"]);
$channel->addChild("language");
$channel->addChild("wxr_version", "1.1", $namespaces["wp"]);
 
/* run through the list of items and add them to the XML */
foreach ($json["items"] as $item)
{
	$rssItem = $channel->addChild("item");
 
	/* a bunch of Google Reader-specific metadata */
	if (isset($item["isReadStateLocked"]))
	{
		$rssItem->addAttribute("isReadStateLocked", $item["isReadStateLocked"]);
	}
	$rssItem->addAttribute("crawlTimeMsec", $item["crawlTimeMsec"]);
	$rssItem->addAttribute("timestampUsec", $item["timestampUsec"]);
	$rssItem->addAttribute("id", $item["id"]);
	if (isset($item["commentInfo"]))
	{
		while (list($commentInfoKey, $commentInfoValue) = each($item["commentInfo"]))
		{
			$commentInfo = $rssItem->addChild("commentInfo", $commentInfoKey);
			$commentInfo->addAttribute("permalinkUrl", $commentInfoValue["permalinkUrl"]);
			$commentInfo->addAttribute("commentState", $commentInfoValue["commentState"]);
		}
	}
 
	/* annoyingly, not every item has its content in the content
	   element -- sometimes it's in the summary element (and once in a
	   while, it's just not there). I think this is an artifact of how
	   the original RSS feeds were constructed. I think. */
	if (isset($item["content"]))
	{
		$content = $item["content"]["content"];
	}
	else if (isset($item["summary"]["content"]))
	{
		$content = $item["summary"]["content"];
	}
	else
	{
		$content = "";
	}
 
	/* sometimes items don't even have titles */
	if (isset($item["title"]))
	{
		$rssItem->addChild("title", $item["title"]);
	}
 
	/* most items store the original linkback information in the
	   alternate element -- Wordpress won't honor this link tag when
	   it's imported (i.e. it won' treat it like the Daring Fireball
	   feed), so I have embedded a more descriptive linkback after the
	   annotations at the start of the content, using some information
	   from the origin element. The linkback is in the
	   "google-reader-alternate-href" div (for easy CSS-wrangling!) */
	if (isset($item["alternate"]))
	{
		$rssItem->addChild("link", htmlentities($item["alternate"][0]["href"], ENT_COMPAT, "UTF-8"));
		$content = htmlspecialchars("<div class=\"google-reader-alternate-href\"><p>Originally posted at <a href=\"{$item["alternate"][0]["href"]}\">{$item["origin"]["title"]}</a></p></div>", ENT_COMPAT, "UTF-8") . $content;
	}
 
	/* I haven't bothered to figure out if the dates are really GMT or
	   localized -- GMT was an easier assumption to make */
	$pubDate = $rssItem->addChild("pubDate", gmdate("D, j M Y G:i:s O", $item["published"]));
	$pubDate->addAttribute("json", $item["published"]);
 
	/* not every item has an a author, either -- again, an artifact of
	   the original RSS feeds */
	if (isset($item["author"]))
	{
		$rssItem->addChild("creator", $item["author"], $namespaces["dc"]);
	}
 
	/* annotations were tricky -- I have added them as their own XML
	   tags _and_ inserted them within a "google-reader-annotation" div
	   at the top of the post content (to match the original format on-
	   screen). All of the original data is preserved in the XML tag,
	   with an ID that matches the embedded div ID. */
	foreach($item["annotations"] as $annotation)
	{
		$annotationHTML = htmlentities("<div id=\"" . md5($annotation["content"] . $annotation["author"]) . "\" class=\"google-reader-annotation\"><blockquote><p>{$annotation["content"]}</p><p class=\"author\">{$annotation["author"]}</p></blockquote></div>", ENT_COMPAT, "UTF-8");
		$content = $annotationHTML . $content;
		$rssAnnotation = $rssItem->addChild("annotation", $annotation["content"]);
		$rssAnnotation->addAttribute("id", md5($annotation["content"] . $annotation["author"]));
		$rssAnnotation->addAttribute("author", $annotation["author"]);
		$rssAnnotation->addAttribute("userId", $annotation["userId"]);
		$rssAnnotation->addAttribute("profileId", $annotation["profileId"]);
		$rssAnnotation->addAttribute("profileCardParams", $annotation["profileCardParams"]);
	}
 
	/* again, sometimes content is in content, sometimes it's in the
	   summary element */
	$rssContent = $rssItem->addChild("encoded", $content, $namespaces["content"]);
	if (isset($item["content"]))
	{
		$rssContent->addAttribute("direction", $item["content"]["direction"]);
	}
	if (isset($item["summary"]))
	{
		$excerpt = $rssItem->addChild("encoded", $item["summary"]["content"], $namespaces["excerpt"]);
		$excerpt->addAttribute("direction", $item["summary"]["direction"]);
	}
 
	/* more Google reader metadata, this time about the original feed
	   that the item came from -- which is used above to format the
	   linkback that is embedded a the start of the content */
	$origin = $rssItem->addChild("origin");
	$origin->addAttribute("streamId", $item["origin"]["streamId"]);
	$origin->addAttribute("title", $item["origin"]["title"]);
	$origin->addAttribute("htmlUrl", $item["origin"]["htmlUrl"]);
 
	/* it's not clear to me whether the published or modified date is
	   when the original post was published or when the item <span class="hiddenGrammarError" pre="item ">was
	   shared</span> -- I think when published refers to when it was shared. */
	$postDate = $rssItem->addChild("post_date", date("Y-m-d G:i:s", $item["published"]), $namespaces["wp"]);
	$postDate->addAttribute("json", $item["published"]);
	$rssItem->addChild("comment_status", "open", $namespaces["wp"]);	// TODO make configurable
	$rssItem->addChild("ping_status", "open", $namespaces["wp"]);		// TODO make configurable
 
	/* make a Wordpress friendly title slug for the post */
	if (isset($item["title"]))
	{
		$slug = sluggify($item["title"]);
	}
	else
	{
		/* if no title, generate the slug from the timestamp */
		$slug = date("Y-m-d-G-i-s", $item["published"]);
	}
 
	/* make sure that our slug  is unique -- add a counter to the end
	   if it is not, and track those counter values in $post_names[] */
	if (isset($post_names[$slug]))
	{
		$post_names[$slug]++;
		$slug .= "-" . $post_names[$slug];
	}
	else
	{
		$post_names[$slug] = 0;
	}
	$rssItem->addChild("post_name", $slug, $namespaces["wp"]);
 
	/* more Wordpress metadata -- all of which could be tweaked */
	$rssItem->addChild("status", "publish", $namespaces["wp"]);	// TODO make configurable
	$rssItem->addchild("post_parent", 0, $namespaces["wp"]);	// TODO make configurable
	$rssItem->addChild("menu_order", 0, $namespaces["wp"]);		// TODO make configurable
	$rssItem->addChild("post_type", "post", $namespaces["wp"]);	// TODO make configurable
	$rssItem->addChild("post_password", "", $namespaces["wp"]);	// TODO make configurable
	$rssItem->addChild("is_sticky", 0, $namespaces["wp"]);		// TODO make configurable
 
	/* convert categories to post tags -- nota bene that Google Reader
	   has conflated the reader's categories with the original post's
	   tags, creating a... mish-mash. */
	foreach($item["categories"] as $category)
	{
		if (!preg_match("|.*/com\.google/.*|", $category))
		{
			$cleanCategory = $category;
			$cleanCategory = preg_replace("|user/\d+/label/(.*)|", "$1", $cleanCategory);
			$rssCategory = $rssItem->addChild("category", htmlentities($cleanCategory, ENT_COMPAT, "UTF-8"));
			$rssCategory->addAttribute("domain", "post_tag");
			$rssCategory->addAttribute("nicename", sluggify($cleanCategory));
			$rssCategory->addAttribute("json", $category);
		}
	}
 
	/* add comments -- note that for privacy reasons, while the
	   commenter's metadata is added as an XML tag, it is not embedded
	   in the Wordpress-readable wp:comment tags */
	foreach($item["comments"] as $comment)
	{
		$rssComment = $rssItem->addChild("comment", "", $namespaces["wp"]);
		$rssComment->addAttribute("id", $comment["id"]);
		$commentContent = $rssComment->addChild("comment_content", $comment["htmlContent"], $namespaces["wp"]);
		$commentContent->addAttribute("plainContent", $comment["plainContent"]);
		$author = $rssComment->addChild("comment_author", $comment["author"], $namespaces["wp"]);
		$author->addAttribute("userId", $comment["userId"]);
		$author->addAttribute("profileId", $comment["profileId"]);
		$author->addAttribute("profileCardParams", $comment["profileCardParams"]);
		$author->addAttribute("venueStreamid", $comment["venueStreamId"]);
		$commentDate = $rssComment->AddChild("comment_date", $comment["createdTime"], $namespaces["wp"]);
		$commentDate->addAttribute("modifiedTime", $comment["modifiedTime"]);
		$rssComment->addAttribute("isSpam", $comment["isSpam"]);
	}
}
 
/* dump the converted XML out as a file */
header ("Content-type: text/xml");
echo $rss->asXML();
file_put_contents("shared-items.xml", $rss->asXML());

Publishing a FirstClass Calendar to Google Calendar (or anywhere else)

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.

Custom Software

One of my colleagues, Matt Zipin (in fact, my high school computer science teacher), just sent me a link to an iPhone app that his current student, Ari Weinstein put together. It was one of those rare moments of seeing a piece of software and thinking, “This… this is exactly what I have been looking for! It’s almost like they had me in mind when they wrote it!”

Perhaps unsurprisingly, I had this reaction because, in fact, Ari has written an application that I suggested. Based on my work at St. Grottlesex as a Thirds’ basketball coach. I had been running practices using the timer and counter apps separately on my iPhone. Which was workable. But unwieldy. Enter.. Ari’s Basketball Timer app, which elegantly and cleanly combines these two tools into a single screen.

I think my favorite part of the app is something that you can’t see, that you can only experience: starting the Time out Timer stops the main clock, and starting the main clock stops the Time out Timer. How simple. How elegant. How easy it would have been to skip over.

Thank you Ari and Matt!

Developing for the App Store with High School Students

I actually really, really want to document some of our projects that we’re working on this year in a great deal more detail. But, for now, I am simply publishing my notes from a conversation that I just had with Apple Education about the legalities of having high school students develop for the app store.

So… I just got off the phone with Apple Education (they were following up on an iOS in Education event a few months ago that I had actually missed). But: I did get the straight dope on Apple Developer accounts and high schools:
  • University accounts are just that: for higher education. Non-negotiable.
  • There are really three levels of developer that are pertinent to high school:
    • Free — they can download Xcode and use the iPhone simulator.
    • Individual ($99) — Same as free, plus they can use their iPhones/iPads to debug the software live (with the right certificates — I’ve found that the easiest way to set up the certificates is directly through the Xcode Organizer). My recollection is that they can have up to something like 100 devices for “debugging.” At this level, they can post apps to the App Store.
    • Enterprise ($299, IIRC) — Individual, plus the ability to manage a fleet of iOS devices (remote install and remote wipe), as well as distributing their software internally with no restrictions. I actually pressed him pretty hard on this, and he wasn’t 100% (“read the language in the agreement first”), but he thinks that it would be viable for the school to buy an Enterprise license and then say “Come by the computer lab and we’ll install our cool in-house app on your iPhone for free.” (Or for money — I don’t think they care.)
  • Apple strongly discourages the school (which would, in reality, be a single individual) signing up for an Individual developer account as the primary distribution channel to the App store for student apps. The rationale being that if a particular app makes it big, the individual who has control of that account well, has control of that account. Apple deals with account holders, not the model that the school constructed. They suggested that if a group of students wanted to band together on an app, that they should sign up as a group for an Individual account through which to distribute that app — and that they should draw up their own contract on their end for how to manage that account.
  • Students under 18 need to be signed up for the account by their parents. (Contract law — the kids are underage.)
At the end of the day, it sounded like my approach this year is basically right on the nose: I have an Individual account in my name that I use to install apps on test iPhones (and I have registered all the student iPhones as debugging devices). The students signed up for free accounts at the beginning of the year. I think what we’ll do when we release this app is sign up for a new Individual account that the students will jointly share to post the app to the App Store (something like “[Jewish Day School] App Design ’10’-’11”).

PHP Script to Add Time Zones to iCalendar/vCal Feeds

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>

Generating an iCalendar feed for a FirstClass Calendar

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.)

Building a Google Earth Tour in a Spreadsheet

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!

Rendering an RSS feed as HTML

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!

Review of OpenText Social Workplace

I wrote this originally in response to a question from [the assistant head at Jewish Day School] about how I think about web tools. After writing this, I chatted with him and [my opposite number in the middle school] about how folks that are using OTSW in the middle school that are more successful — largely because they’re using it as a “gateway drug” to a web presence, rather than trying to bring an existing web presence into one place.

Here my general thoughts on selecting tools for teaching and learning, and how OTSW measures up against them. This is in no way meant as a slam on OTSW, but rather an explanation of my thought process in selecting tools with which to teach and learn, while examining the OTSW system.

In general, when looking at a tool, my first concern is how well it does its intended job — whether intended by the developer or by the user. Education is strewn with unintended, but serendipitous uses of tools never intended for that purpose: consider the military’s use of game systems for training.

Assuming that a tool does what it is intended to do, and does it well, my next concern is how well this tool will connect not just to any existing tools, but specifically to the tools that I already use (although a little forward-thinking at this moment, considering tools I might want to use down the road, is not uncalled-for).

Having looked at these two considerations, the final — and really potentially gamestopping — concern is how well this tool will support a safe learning environment for my students and myself. What “safe” means can certainly be construed in different ways, depending on the purpose of the tool (a discussion tool would certainly have different safety concerns than a research tool).

With these three concerns in mind, let us turn our eye to OTSW and our current set of web tools:

What does it do? And does it do it well?

OTSW provides a Facebook-like environment for users of our FirstClass system. It allows users to post status updates, to maintain blogs and wikis, and to comment on each other’s postings.

User status updates are handled reasonably well — there are no major surprises. The status updates are limited in length (as is true of Twitter, Facebook, SMS messages, etc.) The system will display a somewhat shortened (truncated) version of the status message to users who “follow” that user. The users cannot type a longer status update than will fit into the field, but there is no warning when the status update is longer than can be displayed to one’s followers. Potential uses for these status updates are unknown, but a creative mind could certainly come up with something. Mostly, they’re just for fun.

Consider the blogging system: the word processing system for writing posts is comparable to the FirstClass document editor in the FirstClass client, although perhaps more limited. It is also comparable to the WordPress or MindTouch wiki document editors although, again, perhaps a touch more limited: fewer formatting options, no support of the style associated with structured documents built for the web, limited capabilities for facilitating linking to other documents on the same system.

The blog commenting system is apparently “un-threaded” — or, at least, controls for turning on threaded comments are not apparent. This means that a comment posted in response to another comment is shown in the overall list of comments by date, rather than by thread of conversation. This makes complex, truly interactive asynchronous conversations about a blog post difficult, if not impossible, to read. Additionally, already read comments automatically collapse upon the return to the page (with no preference otherwise), providing limited context for new comments.

The wiki document editing system is somewhat more advanced than the blogging system, allowing for the creation of links to other pages within the specific wiki on which you’re working, although not to other wikis on the OTSW system. Additionally, three styles of structured text (body, heading and subheading) are supported on wikis, as well as a few more rich formatting options.

The organization of the wiki pages within a specific wiki on the OTSW system is flat, rather than hierarchical. While this limits the confusion associated with the page hierarchies on the MindTouch wiki, the presentation of the pages for the wiki is now as a “page cloud” in the tool bar, organized apparently by date of creation or modification (making the placement of pages unpredictable between visits). There is no clear way to move or copy a page from one OTSW wiki to another.

As [one colleague] has correctly noted, another oddity of the OTSW wiki system is that, when commenting on a page, the actual content of the page is hidden (although the other comments on the page are displayed as on the blog, along with links to different versions of the page in its revision history). This is at best unhelpful, and certainly confusing to the novice (or experienced) user.

In both the blog and wiki systems on OTSW, the ability to tag posts and pages with keywords is provided. The tagging system in beta versions of OTSW was highly vulnerable to non-alphanumeric characters in tags (e.g. “Seth’s tag” — the apostrophe in one tag rendered an entire community inaccessible). In the current version of OTSW, non-alphanumeric characters are accepted in tags for display… but clicking the tag link to view all documents tagged with that keyword has unpredictable results (in the case of “Seth’s tag” the link takes the user to a page list all documents tagged “Seth” — which does not include the pages tagged “Seth’s Tag”).

Additionally, depending on what actions have recently been taken in the OTSW environment, the tagging tool will appear in unpredictable locations or may not even be accessible. (As is also the case for initial edits of wiki pages: once posted, the user has to leave the wiki and return in order to find an Edit link for that page.) Tagging wiki pages, at least in Safari, appears to be undo-able, as the tagging tool appears the bottom of the page, with scroll bars turned off, and no save button available.

Considering the apparent purposes of the OTSW system:

  • Status updates: nothing particularly unique or different or unusual, automatic truncation without warning.
  • Blogging: limited formatting options, lack of threaded discussions, lack of ability to link even to other posts in the blog.
  • Wikis: limited formatting options, confusing discussion format, no ability to organize pages.
  • Tagging: easily broken, predictably unpredictable.

Interoperability with Other Tools

When it comes to interoperability with the OTSW communities, the highest priority concern would be how well the tools work with our existing array of tools on campus, including our blog and wiki servers and, especially, FirstClass.

The communities are stored as a special type of conference on the FirstClass server. In current versions of the FirstClass client, clicking on these conferences will open the community in a web browser. When viewed by older clients, these conferences will open to reveal a list of documents (the pages, posts, comments, etc. within the community) with an array of specialized columns reflecting how these documents would be displayed in the web browser.

When a user is invited to a community, they receive an email invitation, with a link to click to accept the invitation. Users who have not already logged in to the web interface to the communities have found that these links often are not active: they do nothing. Ideally, the result of clicking this link is that an alias to that community’s conference will appear on the user’s FirstClass desktop, giving them access to the community. Moving these conference aliases off of the desktop (perhaps into a folder called “OTSW Communities”) renders the group memberships inoperable — the conference aliases must remain on the desktop, although each functions only as a bookmark to the web interface to the communities when accessed through the FirstClass client.

When a user creates a community of their own, a new community conference is created on their desktop, and all pages, posts and documents posted to that community will count against the creator’s FirstClass disk quota.

When a user posts a page, post or comment to an OTSW community, that content is displayed as an outgoing message to the users’s My Shared Documents conference in their mailbox. This is confusing.

In terms of interoperability with our blog and wiki tools, there are three standard ways to connect tools to each other on the web: links, RSS feeds of recent updates and embedding.

OTSW communities do not provide any RSS feeds. Links to OTSW communities, pages or posts, will fail if the user is not currently logged in to the OTSW communities in their browser. Following a link to an OTSW community while not logged in will drop a user into their OTSW desktop, rather than the target of the link. OTSW communities provide no options for embedding their content in other tools.

Looking at the flip side of this interoperability, bringing external tools into OTSW provides a somewhat better picture. OTSW supports regular web links in all posts, pages and comments. OTSW supports attaching any kind of document to a wiki page (e.g. a movie or audio file, or Word document).

OTSW does not provide any facility for subscribing to RSS feeds from other tools.

OTSW does provide some support for embedding external content in OTSW pages, posts and comments. These embeds are performed by pasting arbitrary HTML into the OTSW content embedding dialog. Unlike WordPress, which provides some filtering, OTSW will allow anything to be embedded — and, in fact, embeds most objects as IFRAMES (which allows the embedded site unlimited access to OTSW — not great for security).

One oddity of OTSW embedding is that embedded content is masked by the OTSW embed logo, which must be clicked upon to reveal the embedded content (perhaps as a security measure?). Once the logo is removed to reveal the embedded content (which must be done each time the page is loaded, for each embedded piece of content), the embedded content is presented in an IFRAME exactly the same size as the previously masking logo. The logo is smaller than the standard YouTube video, for size comparison. This means that all embedded content is viewed through what amounts to a porthole.

One possible way around the lack of ability to access an external site’s RSS feed (for example, a feed of recently updated instructional videos from YouTube), would be to use a third party tool such as WebRSS to generate a “badge” which could then be embedded in OTSW.

Considering OTSW’s interoperability with other tools:

  • FirstClass: Rube Goldberg-like dependency on community conferences to remain on the desktop, no warning about disk quota use for conference creators, confusing display of posted content, flaky invitation system.
  • Web Links: outgoing links from OTSW work fine, incoming links are functionally useless.
  • RSS Feeds: non-existent.
  • Embedding: no options to embed OTSW content elsewhere, very limited ability to embed external content in OTSW, requires manifold click-throughs.

Safety

OTSW provides a very well-secured environment for users, in that it leverages our existing FirstClass userbase to automatically limit access to communities. While I have no clear understanding of the true security capabilities of FirstClass, I note that the FirstClass messaging system was, for many, may years, a de facto standard across education — quick and easy to setup, very reliable, very secure. Nine out of ten dentists use it themselves, etc. OTSW does not seem to waiver from the FirstClass security model. In terms of operational security, OTSW appears to be a seamless layer on top of our existing FirstClass system.

Another aspect of security that is well worth considering in a teaching and learning standpoint are the types of habits promoted by a particular tool. For example, blog servers promote, well, self-promotion and publication, hopefully also critical, analytical engagement with external information sources. Wiki servers tend to promote collaboration, with individual accountability, on large documentation and research projects.

As a Facebook-like communication system, OTSW should, then be viewed as a safe learning environment for social networks and media, where students can learn good habits and social graces. Much of the system works in this manner (as did FirstClass in relation to traditional email), providing the ability to track revisions, flag offensive content, engage in asynchronous discussion, etc.

The one oddball is the profile system (and this may be dependent on system settings). By default, the OTSW user profiles are set to demand more and more and more personal information from each user, reminding the users that their “profile is only X% complete… add your [fill in the blank personal information] to complete your profile.” To my mind, without deeper discussion in the classroom, this type of message promotes a culture of thoughtless exposure, rather than a carefully managed digital footprint.