" /> markpasc.org: February 2006 Archives

« January 2006 | Main | February 2007 »

February 22, 2006

Stapler

Stapler, a web site to news feed tool for Radio UserLand

Download Stapler 2.2.6 (06 February 2003, zip)

Screenshot of a single Stapler feed's page Screenshot of Stapler Feeds page

Stapler is an RSS extractor tool for Radio UserLand: it creates syndication feeds from web sites and other content. These feeds can be used with Radio UserLand's News Aggregator or other XML syndication software. General scripts for extracting feeds with CSS-like selectors and regular expressions are included as well as several special purpose scripts, and Stapler is expandable with your own scripts written in Radio's UserTalk language. Stapler features a full tool website for browser-based configuration and documentation. Stapler is published under a BSD license.

You may also be interested in eVectors RssDistiller.

Stapler 2.2.6 is for Radio UserLand 8. Stapler 1.2.0 is still available for Radio UserLand 7.

Installing Stapler

  1. Unzip Stapler.root to your Radio Tools directory.

  2. Open Radio's Tools page. If Stapler is disabled, enable it.

Upgrading Stapler

NOTE: If you have a version of Stapler before 1.7.3 or 1.7.4, upgrade to 1.7.4 before upgrading to 2.2.6, or remove Stapler and install afresh.

  1. Close Radio.

  2. Unzip Stapler.root from the archive over the one in your Radio Tools directory.

  3. Start Radio.

If you have trouble with the install, find a bug, or have any other comments or questions, email me at stapler@markpasc.org with your problem.

Using Stapler

Open the Stapler web site with the Tools->Stapler->"View in browser" menu option (or by going to http://127.0.0.1:5335/Stapler/ in your browser). Click the Help option for instructions on using Stapler.

[an error occurred while processing this directive]

Version history

2.2.6, 6 February 2003: Radio News Errors scanner added; it makes a feed listing your subscriptions that were not successfully aggregated when Radio last did a news scan. Bug in blogHeadlines when using description length limit fixed; new "description mode" available in blogHeadlines, for easily selecting whether to use no description, the whole description, an excerpt of a given length, the first sentence, or the first paragraph.

2.2.5, 31 January 2003: "RSS" scanner added; this is good for making an aggregate feed from several other existing RSS feeds. Stapler should no longer try to scan when you've enabled "Work Offline."

2.2.4, 12 January 2003: Fixed error in counting of new items. Added Dave Winer's codeFreshener code, by way of Andy Fragen's installCodeFreshener tool.

2.2.3, 6 January 2003: Fixed stupid error in the Radio comments scanner; it should actually work now.

2.2.2, 11 October 2002: Added RSS 1.0 format. Apostrophes in scanner and format data fields are no longer incorrectly encoded to "'". Checkbox options are correctly updated when unchecked.

2.2.1, 12 August 2002: Feed descriptions are correctly written to disk. Feeds with no items no longer cause Stapler to write badly formed XML. Added radioComments scanner to provide a feed informing you of new comments to your Radio weblog. The blogHeadlines scanner ignores titles of "Untitled," abbreviating the item content instead. The beforeAndAfter scanner has an "Include Before and After strings" option. Scanner options shown in textareas are now properly escaped. Using the "Subscribe" button only writes the feed to disk if the file didn't already exist. Added StaplerSuite.tools.newItem (feed) script for use by scanner authors.

2.2.6, 6 February 2003: Radio News Errors scanner added; it makes a feed listing your subscriptions that were not successfully aggregated when Radio last did a news scan. Bug in blogHeadlines when using description length limit fixed; new "description mode" available in blogHeadlines, for easily selecting whether to use no description, the whole description, an excerpt of a given length, the first sentence, or the first paragraph.

2.2.5, 31 January 2003: "RSS" scanner added; this is good for making an aggregate feed from several other existing RSS feeds. Stapler should no longer try to scan when you've enabled "Work Offline."

2.2.4, 12 January 2003: Fixed error in counting of new items. Added Dave Winer's codeFreshener code, by way of Andy Fragen's installCodeFreshener tool.

2.2.3, 6 January 2003: Fixed stupid error in the Radio comments scanner; it should actually work now.

2.2.2, 11 October 2002: Added RSS 1.0 format. Apostrophes in scanner and format data fields are no longer incorrectly encoded to "'". Checkbox options are correctly updated when unchecked.

2.2.1, 12 August 2002: Feed descriptions are correctly written to disk. Feeds with no items no longer cause Stapler to write badly formed XML. Added radioComments scanner to provide a feed informing you of new comments to your Radio weblog. The blogHeadlines scanner ignores titles of "Untitled," abbreviating the item content instead. The beforeAndAfter scanner has an "Include Before and After strings" option. Scanner options shown in textareas are now properly escaped. Using the "Subscribe" button only writes the feed to disk if the file didn't already exist. Added StaplerSuite.tools.newItem (feed) script for use by scanner authors.

2.2.0, 23 July 2002: Feeds can be exported to and imported from XML files. The beforeAndAfter scanner, which makes items from whatever is between specified strings, is available. Regex scanner now uses patterns of backreferences (eg \1: \2) instead of groups for item data. Stapler provides an option to disable upstreaming in its publishing directory. Scanners' scanner-specific data can be presented in textareas, not just text fields.

2.1.0, 12 July 2002: Weather Underground scanner is fixed. The selector scanner can be called by other scanners without passing a feed. Pages in Stapler's HTTP cache more than a week old, such as those for feeds with date variables in their URLs, are deleted. The HTTP user-agent string Stapler users is settable in preferences.

2.0.3, 23 May 2002: Recursion problems attempting to upgrading the data file are fixed. Whether it's time to scan is calculated more safely with respect to bad input data.

2.0.1, 23 May 2002: The "Subscribe" button didn't work. Stapler would only automatically upgrade its data table before a scan; now it also does so when viewing Stapler's web page.

2.0.0, 21 May 2002: Stapler no longer uses the concept of sources that are grouped into feeds; there are only feeds, some of which aggregate the items of other feeds. This is a big internal change.


1.7.4, 5 May 2002: The blogHeadlines scraper honors posts' titles, if present. The "upgradeData" script is run automatically during the hourly scan if it needs running. Problem conditions discovered by the upgradeData script were displayed in dialog boxes that were sometimes too small for their messages; these errors are now written to the Radio Events Log, with appropriate dialog box. Interim release before Stapler 2.0, if all goes according to plan.

1.7.3, 2 February 2002: fixed syntactical bug in "Republish feeds" script and HTML stripping bug in blogHeadlines scraper.

1.7.2, 1 February 2002: Directories to which to publish files are automatically created ("staplerFeeds" error); publish buttons and menu option work all the time; item links are made non-relative when scraped; blogHeadlines scraper ignores items with unchecked "Home Page" categories; new HTML document type and siteChanged scraper.

1.7.1, 22 January 2002: "Upgrade data" bug in which Stapler would incorrectly try to upgrade data from versions 1.1.0 and later directly to 1.7.0; #subtemplate.txt was being written out incorrectly, resulting in a totally unusable tool website.

1.7.0, 21 January 2002: After several prereleases, the first version of Stapler for Radio 8. Support for Radio 8's status center, filesystem-based tool website, and tool info on the tools page; subscribe to feeds within Stapler; OCS 0.4 document type and scraper for producing an OCS feed of your Stapler feeds; compact lists on main sources and feeds pages; more self-contained install.


1.2.0, 29 September 2001: Feeds can be published in RSS 0.91, RSS 0.92, or any document formats you add; feeds have "View Feed" pages; Weather Underground scraper; feed "never scanned" bug fixed; more control options for scraping sources.

1.1.3, 30 June 2001: Feeds no longer have "by Stapler" appended to their titles; items without descriptions are correctly published; conversion of URLs from relative to absolute fixed; blogHeadlines scraper for making a headline feed for one's MUOTD weblog included; help pages include blogHeadlines and the options added to the regex scraper in 1.1.2.

1.1.2, 14 June 2001: A feed is published if its file is missing, even if there are no new items; regex scraper now works.

1.1.1, 13 June 2001: Fixed scraper-related bugs in the StaplerData upgrade routine.

1.1.0, 12 June 2001: Regular expressions scraper; View Source page; redesigned, non-table-based Web interface; see StaplerSuite.TODO outline in database for complete list.

1.0.3, 19 May 2001: Fixed hard-coded addresses. Removed my sources (hee-hee).

1.0.2, 19 May 2001: In the ByNumbers scraper, fixed incorrect conversion from relative to absolute URLs. Fixed when a source would not be added to the feed when its Use <link/> option was enabled and its feed had no template set, in StaplerSuite.scrape.

1.0.1, 18 May 2001: Fixed incorrect ignoring/converting of a source's hours property in StaplerSuite.scrape.

Kit

Kit, a suite of page tools for Radio UserLand

Download Kit 1.2.1 (28 January 2003, zip)

Kit is a suite of "page tools" for Radio UserLand 8, including Weblog search, an improved News Aggregator page, a web Quick Script, "Radio to the Past" for changing weblog items' dates, a web outline editor, a per-category weblog index, a subscribed feeds lister, file uploader, and the Kit dashboard. Kit is published under a BSD license.

Installing Kit

  1. Unzip Kit20030128.zip to your Radio Tools directory.

  2. In the Radio application, select Tools->Kit->"Install pages to..." and enter the directory to which to publish Kit's pages. For example, if you enter system, your Kit pages will be at http://127.0.0.1:5335/system/ . Installing to system\pages (or system:pages) will overwrite some of Radio's default system pages with Kit's enhanced versions; this is suggested, but if you want to leave Radio's pages alone, feel free. (If the Tools->Kit menu isn't present, you may need to restart Radio.)

If you have problems with install, find a bug, or have any comments or questions, email me at kit@markpasc.org with a description of your situation.

Using Kit

After installation, open your browser and point it at http://127.0.0.1:5335/Kit/. Radio will forward you to the Kit Dashboard. The dashboard has links and basic forms for Kit's other pages, and your Radio Status Center (just like on the Home Page).

Some features will only be enabled after checking them on the Kit Preferences page. The HTTPS news aggregation feature requires the free Macrobyte TLS for Radio client software.

Using News Aggregator

Screenshot of News Aggregator's time selection form

This is an enhanced version of Radio's own News Aggregator page. At the bottom is a form for controlling what news items are shown. By default, the page shows all items scanned in the last hour.

You can assign feeds to categories on the News Preferences page. The dropdown at the bottom of the News Aggregator page will let you view the feeds in a particular category. You can also set background colors for particular feeds on the News Preferences page.

Kit's News Aggregator can fix broken HTML in your scanned news items. Check the "Repair improper HTML in news items" box in the Kit Preferences page, and Kit will do its best.

By default, News has a simple CSS layout that resembles the stock News Aggregator's. If you want, you can hack at the strings at the top of the file to put the news items in a different (even table-based) format. Look for the script at the top that sets the preText, postText, channelText, and itemText variables.

Using TrackBack

After enabling TrackBack in the Kit Preferences page, it will show in the weblog post form. Paste the TrackBack URL into the box, and when your post is posted, the URL will be pinged with TrackBack.

Using Do

Screenshot of using Do as a table browser

Do is a web-based Quick Script. Enter the UserTalk script you want to execute and click "Do." To repeat a recently executed script, click the corresponding "Do:" button.

If the expression returns a table, outline, or script, Do will "pretty-print" the result. That means Do is also (somewhat) useful as a table browser.

Be aware that Do can do unsafe things like print your passwords to the screen, which is bad if done remotely and in plaintext.

Using Search weblog

Enter your search query and options. Search weblog will show the results, rendered in your #itemTemplate. If your #itemTemplate includes the <%editButton%> macro, it will be shown so you can easily edit those items. Permalinks rendered as relative links will not point at the actual item.

Using Edit outline

Screenshot of the outline editor

Edit outline is a web-based outline and script editor, using the JavaScript and CSS code from Joshua Allen's XSLT for OPML. I wrote bits that tie the JavaScript into Radio, and modified the JavaScript to use the standard DOM and different key sequences.

Enter the address of your outline or script--such as workspace.blog.outlines.todo or StaplerSuite.tools.stripHtml--in the form field, and click "Edit." The page will reload with the outline in it.

If you don't see the outline, or it's qualitatively different from the screenshot, your browser may not support the CSS, DOM, DHTML type stuff the outline editor requires. The editor also may not work in Internet Explorer, since I can't easily debug JavaScript for it.

Click the arrows to collapse and expand trees. Click a line's text to select it, then operate on it with these keys:

Keys for the outline editor
KeyFunction
ctrl-KEdit the link
ctrl-\Toggle comment
F2Edit the text
ctrl-Enter
InsertAdd new line
DeleteDelete selected
ctrl-UpMove the selected line around, like in Radio's outline editor
ctrl-Down
ctrl-Left
ctrl-Right

Edit outline has callbacks for when an outline is saved. These callbacks should be in the KitData.callbacks.edit.save table, and have the signature scriptName (adrOutline).

Feeds

feeds.txt generates a list of your subscribed feeds; the file is suitable for moving to a published directory for upstreaming. It's like Jon Udell's, but is intended as its own page (I have a lot of feeds). It also strips out passwords in feed URLs, and yields for local (http://127.0.0.1:5335/...) feed URLs.

Tweak it in a text editor if you like.

Category Index

Category Index (categoryIndex.txt) provides navigation for your (possibly topical) categories for which you don't want a full HTML rendering. Copy the categoryIndex.txt as index.txt to your categories' directories. Check the "Update category indices" checkbox on the Kit Preferences page to automatically upload these indices when you post to their categories.

Put file

Put file lets you upload a file directly in your browser. Select the file to upload, where to put it, and hit "Put." Easy.

Where to put the file can be a folder or a full filename. If you specify a folder, Put file will use the same filename the browser tells Radio the file had on the uploading system. If you specify a full filename, any folders that must be created to put the file there are created--so don't inadvertently transpose two directories in the path!

There's currently a bug in which Put file doesn't understand the filename IE says the file had on the local system; if you use IE, specify full filenames.

Radio to the Past (and Future)

Screenshot of Radio to the Past

Radio to the Past is the colloquial name the Radio discussion group gave being able to change the date on a weblog item. This tool allows you to change the date of an item you posted to the weblog. Enter the post ID (look for the itemToEdit argument in the "Edit" link on the Home Page), set the date, and go.

A Radio to the Past date selector also appears on the weblog post page, if you select the "Toggle Radio to the Past" option in Radio's Tools->Kit menu.

NOTE: Radio to the Past is fairly experimental. You probably shouldn't use it yet if you find parts of Radio bewildering.

Radio to the Past is also Radio to the Future: if you specify a time in the future, the post will be held in reserve (or cryonic suspension if you prefer) until the time you posted it (or up to a minute after). Then Radio to the Past will post (thaw) it to your weblog like any other item.

Another gotcha: unless you've done massive customization, moving items around in the past breaks Radio's permalinks. (Insert space-time continuum joke here.) If you plan to use Radio to the Past a lot, you may want to use an alternative set of IDs for your permalinks; Radio to the Past provides three functions for this:

KitSuite.past.itemnum
Returns just the numerical tag for the item. Use in a comment URL or anywhere you need just a number. (I know YACCS has problems with non-numerical item IDs.)
KitSuite.past.permalinkID
Returns the anchor name; HTML anchor names can't start with a numeral, so this is "i" followed by the itemnum above. Use in an <a name/> or as a container ID.
KitSuite.past.permalinkUrl
Returns the permalink URL with the permalinkID for its #anchor. Use this in an <a href/>.

Each function takes the item's real itemnum as the argument. For example, you'd call KitSuite.past.permalinkUrl with something like:

<a href="<% KitSuite.past.permalinkUrl ("<%itemnum%>") %>">#</a>

Also, Radio to the Past's mechanism is exposed enough for other program authors writing weblog import tools to use. Call KitSuite.past.toPast (adritem, when, touch:false) and Kit will put the weblog item table at adritem in the right place in weblogData.root. when is the UserTalk date value at which to place the item. If touch is true, toPast will mark the affected weblog archive pages for upstreaming (so if you're importing a bunch of items, pass false).

Version history

1.2.1, 28 January 2003: Error when setting Kit preferences with HTTPS subscriptions enabled fixed. Error in News page when fixing HTML nesting was disabled fixed.

1.2.0, 19 January 2003: The just-links category index page displays item titles correctly. News Preferences can now clear colors and categories. View all items of a particular feed (the "hourglass" view) like on Radio's news page. Kit's link on the Tools page forwards to your Kit Dashboard. Weblog search will search both titles and bodies. News has a "Show all aggregated news" option (mainly for searching). News repairs broken HTML (unclosed tags and attributes) in news items. Publish RSS using your item template (your permalinks, comments links) including with expanded shortcuts (I think). Ping TrackBack URLs when entering a weblog item. Subscribe to news feeds over SSL (HTTPS); requires Macrobyte's SSL client software.

1.2.1, 28 January 2003: Error when setting Kit preferences with HTTPS subscriptions enabled fixed. Error in News page when fixing HTML nesting was disabled fixed.

1.2.0, 19 January 2003: The just-links category index page displays item titles correctly. News Preferences can now clear colors and categories. View all items of a particular feed (the "hourglass" view) like on Radio's news page. Kit's link on the Tools page forwards to your Kit Dashboard. Weblog search will search both titles and bodies. News has a "Show all aggregated news" option (mainly for searching). News repairs broken HTML (unclosed tags and attributes) in news items. Publish RSS using your item template (your permalinks, comments links) including with expanded shortcuts (I think). Ping TrackBack URLs when entering a weblog item. Subscribe to news feeds over SSL (HTTPS); requires Macrobyte's SSL client software.

1.1.7, 26 July 2002: Search results' permalinks now point to the published item. Clicking the time data fields on the News Aggregator page in Mozilla doesn't put the focus on the radio button, merely selects it.

1.1.6, 16 June 2002: A Radio to the Past date selector optionally appears on the weblog item post page.

1.1.5, 25 May 2002: The News page has a link to the subscriptions page. When removing its files from the system\pages or system:pages directories, Kit replaces the original files.

1.1.4, 23 May 2002: Radio to the Past had problems when categories were disabled; this is fixed. Radio to the Past's code for discerning the item number one entered was improved, so "Edit" link URLs should in fact work now.

1.1.3, 22 May 2002: Radio to the Past flat-out didn't work. This is fixed.

1.1.2, 14 May 2002: Radio to the Past wouldn't really move items, just copy them. Also, sometimes Radio would present the Radio to the Past CSS file rather than the HTML file. These are fixed.

1.1.1, 13 May 2002: Radio to the Past can now place items before item #1; the year option correctly reflects the selected item's year; the table-moving crasher bug mentioned in the announcement should no longer occur. (Thanks, Jeremy Bowers and Jake Savin.) The Feeds page handles malicious services with blank channel titles (such as Geeknews.net) more correctly. The Dashboard page is now automatically generated when Kit's pages are written out.

1.1.0, 12 May 2002: The Radio to the Past (and Future) tool was added. The Search page can search in either item bodies or titles. The Search page would error when the "Automatically generate item links" feature was enabled. (Thanks, Mark Woods.)

1.0.1, 2 May 2002: News' form's category selector was ill-behaved. Clicking in time-selection fields selects the correct time mode now. If a script in Do returns a table or outline, they are printed with renderObject and appropriate renderers (the previous table display code is factored into a renderer script).

1.0, 29 April 2002: News' form is redesigned. Showing by time limits now supplements rather than replaces showing by duration and offset. Viewing by category works. Not unsurprisingly, my patience ran out before the 0.9.x version numbers did. Kit is now self-proclaimed shareware.

0.9.6, 18 April 2002: Search now understands the new <%commentLink%> and <%itemTitle%> macros. (Thanks, Phil Wolff and Rob Jorgensen.) An HTML typo in News prevented the post link from working in browsers that didn't DWIM; no longer. (Thanks, Jim McGee.) A "News Preferences" page for specifying colors and categories for feeds was added; the pseudomacro <%color%> in the channel and item templates are replaced with the empty string, or background-color: color; if a color is defined for that channel.

0.9.5, 24 March 2002: "Put file" correctly handles specifying a filename as where to put; it still incorrectly interprets the filename given by IE. "Edit outline" has outline-saved callbacks. "Do" handles returned tables more usefully.

0.9.4, 17 March 2002: "Put file" page and "Toggle category index updates" menu option added. Search results are displayed most recent first. Edit outline correctly no longer errors on only a GET parameter. "Install pages to..." doesn't delete pages if installing to the same directory, which previously resulted in uninstalling the pages.

0.9.3, 9 March 2002: Feeds list doesn't show "user:pass" logins anymore. Feeds list shows the upstream URL if a service URL starts with http://127.0.0.1:5335/. Feeds list alphabetizes by channel name instead of XML URL. Outline editor uses real owner data for its interim OPML, instead of claiming you're Bob Vila. Outline editor correctly changes outlines when submitting one in the form but one is already specified in the URL, handles scripts, and escapes HTML in outline text. Do abbreviates long scripts, and correctly deletes old scripts to make room for new ones. Category index looks each minute for new items so it can update categories' index pages. Kit remembers where you installed its pages, and keeps them there; if you change where you installed them, they are deleted from the old directory.

0.9.2, 4 March 2002: Fixed News Aggregator's "post" buttons. Added Feeds list and category index page. History for Do still doesn't bump after filling.

0.9.1, 25 February 2002: Added outline editor, 7-item history for Do. HTML in News page exposed for easier editing. The "Install pages to..." menu option always writes the pages, overwriting any changes to the files in the filesystem.

0.9, 23 February 2002: First public release. Contained do, search, and news pages.

Friends Tool

Friends, a tool for Radio UserLand

Download Friends 1.1 (02 February 2002, zip)

Friends publishes select feeds scraped for your Radio News Aggregator to a "Friends" page, similar to LiveJournal users'. Friends is configured through its tool website and is published under a BSD license.

To install, unzip Friends20020202.zip to your Radio Tools directory. After enabling the tool on Radio's tools page if necessary, open the tool website and configure it.

Thanks to Bill Kearney for many suggestions that made 1.1 suck less.

Footbridge

Footbridge, a lightweight tool to mirror Radio categories to Advogato, LiveJournal, and Blogger API sites

Download Footbridge 1.4 (20 April 2003, zip)

Footbridge is a lightweight tool to mirror Radio posts to community web sites. It will post to Advogato diaries, LiveJournal journals, and Blogger API sites including Movable Type weblogs. Footbridge is published under a BSD license.

You may also be interested in UserLand's Manila-Blogger Bridge Tool. Footbridge uses the same Blogger API code in Radio as the Manila-Blogger Bridge Tool.

If you enjoy Footbridge and wish to help continue its development and the development of nifty software like it, see the "Shareware" file in the Footbridge archive.

Installing Footbridge

  1. Unzip Footbridge.root to your Radio Tools directory.

  2. Open Radio's Tools page. If Footbridge is disabled, enable it.

  3. In the Radio application, select Tools -> Footbridge -> Install callback.

Upgrading Footbridge

To upgrade Footbridge, unzip the Footbridge.root from the Footbridge20030420.zip file over the one in your Radio Tools directory. The next time Footbridge runs, it will make the necessary changes to upgrade your data to the new version.

Configuring Footbridge

You have to tell Footbridge what categories to mirror where and with what account. Go to the Footbridge configuration page or select Tools -> Footbridge -> View in browser in the Radio application. Follow the links at the tops of the "Category" and "Password" columns to add any necessary categories and passwords to Radio, then configure the categories to mirror and select the Save button. (The "Home Page" category is the same as on the weblog post page: all posts except those for which you uncheck the Home Page checkbox will be mirrored to your "Home Page" category.)

If you're posting with the Blogger or LiveJournal protocols to somewhere besides Blogger or LiveJournal—say, a Movable Type site, or uJournal—enter the . For a Movable Type site, the URL is that of your mt-xmlrpc.cgi script. For LiveJournal (such as uJournal), the URL is the site's /interface/flat script (such as http://www.ujournal.org/interface/flat).

If you have trouble with the install, find a bug, or have any other comments or questions, email me at footbridge@markpasc.org with your problem.

Using Blogger API

When using the blogger driver, use "username@blog ID" for your Footbridge username. For example, if your Blogger username were moose and your blog ID were 31097412, you would enter moose@31097412 as your username on the Footbridge configuration page. If you were posting to the first weblog of a Movable Type site, you would enter moose@1 as your username.

As with any Blogger API application, when posting to Blogger proper, you must save your FTP username and password in your Blogger settings for it to work.

Version history

1.4, 20 April 2003: Categories with spaces in the name (including "Home Page") were not properly saved.

1.3, 11 November 2002: Added "URL" option to post to other Blogger API and LiveJournal sites besides Blogger and LiveJournal.

1.2, 13 July 2002: LiveJournal "Don't auto-format" option added; preliminary Blogger API support.

1.1, 30 June 2002: "Home Page" is now a usable category.

0.1, 22 May 2002: Added LiveJournal support. First release.

blogSearch

blogSearch, a weblog search interface for Radio UserLand weblogs

Download blogSearch (20 May 2001, zip)

NOTE: blogSearch is for Radio 7. Kit includes a weblog search tool for Radio 8. You can search your Movable Type weblog already, but with a little help can do so from the Phoenix/Firebird/Mozilla Browser navigation bar or Mozilla sidebar.

blogSearch is a website tool for Radio UserLand that offers a simple search interface to a Radio weblog. blogSearch is made available under a BSD license.

To install, unzip the blogSearch.fttb file somewhere and open it in Radio UserLand. It will ask if you want to place it at myUserLandData.websiteTools.blogSearch; answer OK. The tool will come up in a table window; just close it. blogSearch is ready to use.

To use blogSearch, go to your MUOTD tool website and select Tools at the top. Select Blog Search and use the search form to search your weblog.

Watch command

Watch command, a command for adding highlight triggers

Download Watch command 1.0 (24 April 2003)

Watch command lets you easily add a trigger to highlight a string of text (such as a name), similar to how /gag lets you easily add a trigger gagging a certain string of text.

Using Watch command

To install:

  1. Save the script as init_js\watch.txt, or append it to your user_init_js.txt. Restart Beip so the script takes effect.
  2. Create a global trigger configured as you'd like the watch triggers. (Mine are Whole Word, Match Case, and Change Foreground to RGB 128,255,128.)
  3. Enter /watch for the text of your trigger and check the "Disabled" box.

To use, type /watch name to add a trigger to highlight name. If you're connected to a particular character, it'll set a character-specific trigger; otherwise it'll set a world-specific trigger.

Vector graphics applet

Vector graphics applet

A Java applet that lets you draw a diagram for use in the BeipMU MUD client's vector diagram drawing window.

Download VGApplet.jar (applet with source)

Song spammer

Song spammer, for annoying people with what's in your music player

Download Song spammer 1.0 (04 August 2003)

Song spammer copies the title of the currently playing song in Winamp (or Foobar2000 with an additional plugin) to Beip's input window, or, if you've set a command format ahead of time, sends it to the current MU* as a command. You should have BeipMU beta 2.00.145.

A screenshot showing use of the plugin's songfmt and song commands.

Using Song spammer

To install:

  1. Place the song.beip plugin file in your Beip directory.
  2. Download r1dll and put the r1dll.dll in your Beip directory. If you're using Foobar2000, get the foo_winamp_spam component too and install that.
  3. Open your user_init_js.txt file and add this line to the bottom:

    run('/loadmodule song.beip');

  4. Typing /song will now paste the title of the current song in the input window. If you want to send the title in a particular command, such as a particularly formatted pose, you can type /songfmt your format where your format is the command to send the MU* with %% in place of the song title. For example, to send : o/~ The Sundresses - Universe.universe o/~ when listening to that song, you would type /songfmt : o/~ %% o/~ .

    To automatically set your format when Beip starts, add this to your user_init_js.txt file after the previous run line:

    run('/songfmt your format');

Future enhancements

  • When Beip's MCP support is better, I'd like to support an MCP query message for what's now playing, so I can make an np command that shows the folks in the room like whospecies, but with what they're listening to rather than their species.

Bubble tip toaster

Bubble tip toaster, for "toasting" XP bubble tips from triggers

Download Bubble tip toaster 1.0 (24 April 2003)

Bubble tip toaster displays pop up messages from Beip triggers, using the bubble tip feature of Windows XP's tray icons. You should have BeipMU beta 2.00.145.

A screenshot showing a Windows XP bubble tip.

Using Bubble tip toaster

To install:

  1. Place the Toast.beip plugin file in your Beip directory.
  2. Open your user_init_js.txt file and add this line to the bottom:

    run('/loadmodule Toast.beip');

  3. Add the triggers you want. Under the "Extensions" tab, select Bubble Tip Toaster to pop a bubble tip containing lines that trigger your trigger. The "Only when: Away" option is useful for these—the trigger will only fire when you aren't in that BeipMU window (presumably you can see the line just fine if you are). I use one like:

    • Text: Somewhere on the muck,
    • Line Starts With
    • Only when: Away
    • Extensions: Bubble Tip Toaster

    to get watchfor notifications in bubble tips. You might also use one for important pages/whispers.

Future enhancements

  • Bring up the triggering window if the bubble tip is "activated" (clicked, but not on its Close button).

TBPY

TBPY by Mark Paschal <markpasc@markpasc.org>

tbpy.txt

TBPY is a Trackback server CGI for the rest of your site. Rather than accepting pings for numbered weblog entries, it accepts pings for pages of your static or dynamically generated web site. Invoke TBPY through SSI to include your pages' Trackbacks and the appropriate RDF for automatic Trackback discovery, or include the RDF (static) and Trackbacks (through RSS files) yourself.

URLs ending in index.html are taken to be the same as those missing. If your pages end in .php, you'll have to modify the code.

Installing

  • Get the CGI script.
  • Install the CGI script somewhere it will run (eg: ~/public_html/trackback/tbpy.cgi). Create a data directory below its directory (eg: ~/public_html/trackback/data), with permissions such that your web server can create files there.
  • Configure as described below.

Configuring

To insert the RDF and Trackbacks for the including page with SSI, call the script with include virtual:

<!--#include virtual="/trackback/tbpy.cgi"-->

If you don't have or want to use SSI, insert the appropriate RDF yourself. It looks like this:

<!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> <rdf:Description rdf:about="URI for this page" dc:identifer="URI for this page" trackback:ping="http://www.foo.com/tb.cgi/5" /> </rdf:RDF> -->

The Trackbacks will be written as RSS 0.91 in .xml files in your data directory, with the absolute URL of the page--slashes and periods replaced with underscores--for the filename. For example, Trackbacks for markpasc.org/code/tbpy/ are saved as code_tbpy_.xml.

When inserting with SSI, TBPY reads an HTML template from the template.html file in the tbpy.cgi script's directory. The first line should be a block header, the last a block footer, and the lines in the middle are repeated for each Trackback. Variables will be replaced in the standard Python % dictionary manner. The term will be replaced with an HTML comment if for some reason the value is not present.

For example, if you don't give a template.html file, TBPY will pretend the file reads:

<div class='tb'><h4>Trackbacks (<a href='%(dataUri)s'>RSS</a>)</h4> <h5><a href='%(link)s'>%(title)s</a></h5> <p>%(description)s</p> <p class='about'>by %(blogName)s at %(date)s</p> </div>

The variables available in the header and footer are:

resourceUri
The absolute URL of the page.
tbUri
The absolute URI to ping, to add a Trackback to the page.
dataUri
The absolute URL of the data RSS file for this page.
title
The title for this page.
description
The description for this page.

A default title ("Trackback for url") and description ("Pages and weblog entries that linked to url") are assigned originally. You can set your own by editing the RSS data file for a given page.

The variables for the individual Trackbacks are:

title
The title of the entry or page linking to the page, as provided in the Trackback ping.
link
The provided backlink URL.
description
The provided excerpt of the entry linking to the page.
blogName
The provided name of the site that sent the ping.
date
When the ping was sent, in YYYY-MM-HHThh:mmZ format.

To-do

  • Recognize index.* as instead of just index.html.

POT.py

Publishing-Oriented Templater by Mark Paschal <markpasc@markpasc.org>

POT.py 1.3 (zip archive)

NB: 1.2's .manifest files are incompatible with 1.3. Run with -1 and delete your .manifest before upgrading, then run with --lie afterward to rebuild the .manifest file.

NB: 1.3 uses the Python 2.3 logging module. You'll need Vinay Sajip's compatible logging module to run POT.py with Python 2.2.

POT.py is an engine for publishing HTML files with embedded Python code by FTP. POT.py requires options to tell it what to publish; these are:

-h host
the FTP server to which to upload
-u user
your username on that server
--pass pass
your password on that server (if omitted, POT.py will prompt you for it, so you don't have to type it on the command line)
-r remotedir
the directory on the server that's the "root" of the site
-L localdir
the local director that's the "root" of the site

POT.py will publish every file in and under the specified local root directory to the server, relative to the specified remote root directory.

Dot files

As exception to the above, POT.py does not publish any file the name of which starts with a period. (UNIX uses the period to denote a hidden file.) If you don't want to specify these options on the command line, you can save them in an .ftpData file in the directory where you run POT.py. This file is run as Python code; here's an example:

# Publish my site to myisp.net/~markpasc/
user = 'markpasc'
host = 'ftp.myisp.net'
password = 'steak'
remoteDir = '/home/markpasc/public_html'
localDir = '.'

Since ".ftpData" starts with a period, the ftpData file is not published even if, as in the example, the local root directory is the current directory. POT.py employs two other special dot-files:

.manifest
POT.py's list of what it's published. It is currently not human readable (it's a "pickled" dictionary).
.include
When HTML files are parsed for Python code, POT.py first executes the contents of all the .include files down the directory tree from the root to the parsed file.

POT.py discovers what needs publishing by looking in its manifest, saved in the .manifest file in the root directory. POT.py keeps track of all the files it publishes, by the "mtime," or last modified time, for normal files, and by the MD5 hash for HTML files. (Since Python code in those HTML files is executed, their uploadable results may change without their unparsed content changing.)

Here's a basic example:

<?inherit('.header.html')?>
 
<p>Hello, world! 2 + 2 = <?2+2?>!</p>
 
<p>The sum of 1 to 100 is <?
ret = 0
for i in range(1,101):
    ret += i
print ret
?>
</p>
 
<?inherit('.footer.html')?>

POT.py parses text inside <? and ?>, as highlighted in the example, as Python code. The example shows the difference between expressions and embedded scripts: code that can be stuffed on one line and is, syntactically, a Python expression can be placed inline like <?2+2?>. Code that doesn't count as a Python expression, such as the long script with the for loop, should be written as shown and must use print (or otherwise output to stdout) to "return" a value.

The example also uses POT.py's inherit function. POT.py provides several variables for use in your templates:

dynamic
1 if the file is being uploaded, or 0 if it's merely being tested for change. Test dynamic to see if you should include content that always changes; for example, a random quote, or a real timestamp (though you should probably use the file's mtime anyway). Returning a static value when POT.py tests for change will prevent the file from uploading every time.
filename
The base filename of the file being rendered. POT.py always evaluates pages from in their directories, so you can use os.path.abspath or os.getcwd to get the path part.
include(filename)
Evaluate the given file as a Python script. Included documents are executed in the same context as the current document, so any variables, functions, &c you've declared already are available in the included document. Note the filename is relative to the parsed file—you probably only want to use this for files in the same directory. (include is a very simple wrapper for str(Document(open(filename, 'r'))).)
inherit(filename)
Evaluate the given file as a Python script. Unlike include, inherit will look up the directory tree until it finds filename. Use this instead of include for, say, templates that you want to store in your web site's root directory.

An example

At the top of this document (in its unpublished form on my computer) is:

<?
title.append('POT.py')
style += "span.potcode { background-color: #0c9; }\n"
print inherit('.header.html')
?>

.header.html might contain:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head>
 
<title><?
fulltitle = ''
for segment in title:  # which is a list
    fulltitle = segment + ": " + fulltitle
if fulltitle: print re.sub(r'<[^>]*>', '', fulltitle) ?>
markpasc.org</title>
 
<style type="text/css"><? style ?></style>
 
</head><body>
 
<h1><? fulltitle[:-2] ?></h1>
...

See how .header.html prints the contents of the style variable inside the <style/> tag, and collapses the title list to make the nice <title/> and leading header on this page. (Also note that the inherit needs printed, since it's part of an embedded script, not a single expression.)

Whither .include? For one, by Python's rules, those variables style and title have to be initialized; .include files are good for that. Also, say a subdirectory has several subpages in it, like this site's code/ section. The sidebar can be set in a sidebar variable in code/.include and referenced in .header.html so all the pages under code/ have the section's sidebar. The sidebar's HTML is only given once—or even, as is the case with this site, generated from a Python dictionary containing the names of subdirectories, project names, and descriptions.

Other options

Lastly, POT.py has three other command line options:

-1
Upload once and stop running. Unless you give this option, POT.py will continue to run, rescanning the directory for changes.

--lie
Only update the manifest; don't actually upload anything. Quits after one scan, like -1. Useful if you are, say, converting a site over from plain HTML and have a lot of images and other content files that are already on the remote site, or if POT.py's manifest gets out of sync or encounters errors uploading.
-q
Run quietly; that is, don't print normal narrative output, only errors. Use this if you're running POT.py from cron, etc.

POT.py is a replacement for publish, an HTML preprocessor I threw together in Perl, so its design is heavily informed by the shortcomings and annoyances I discovered with it, as well as some of the "upstreaming" architecture of Radio UserLand. I hope you find it as useful (or at least as thought-provoking) as I do.

Version history

1.3, 22 August 2003: Made SpyDict class a dict, not a UserDict (NB: this broke .manifest file compatibility). Use standard logging module. Internal stylistic improvements.

1.2, 29 April 2003: Added inherit function, to source.

February 8, 2006

AtomAppCallback

AtomAppCallback, for adding callbacks to Atom entry posting

Download AtomAppCallback 1.0

AtomAppCallback enables the creation of Movable Type plugins that hook into the creation of new entries posted with the Atom API.

Using AtomAppCallback

AtomAppCallback provides three callbacks. Plugins register them in the normal way, that is:

MT->add_callback('AtomNewEntryPreSave', 5, $plugin_obj, \&my_callback);

The callbacks are:

AtomNewEntryPreCreate($cb, $app, $atom_entry)

This callback is invoked before Movable Type begins to build the MT::Entry for the given XML::Atom::Entry. Modifying $atom_entry will affect how the MT::Entry is built by Movable Type.

AtomNewEntryPreSave($cb, $app, $atom_entry, $entry, $orig_entry)

This callback is invoked when the new MT::Entry created from $atom_entry is being saved.

AtomNewEntryPostSave($cb, $app, $atom_entry, $entry, $orig_entry)

This callback is invoked when the new MT::Entry created from $atom_entry has just been saved.

Sample plugins

Two sample plugins that use these callbacks are included. If you do not wish to use them, don't install them, or disable them on the Movable Type System Overview → Plugins page.

UniqueID

This plugin uses the AtomNewEntryPreSave callback to (a) reuse the Atom entry id, if included in the post, as the new MT::Entry's Atom id, and (b) prevent creation of duplicate items posted with the same Atom id by interpreting the duplicate post as an update to the existing entry.

KeywordSubject

This plugin uses the AtomNewEntryPreCreate and AtomNewEntryPreSave callbacks to save dc:subjects in the posted Atom entry as a set of keywords instead of as a category name.