blog.scriptdigital.com
[Archives]
Emmanuel M Décarie's weblog on scripting.
Mostly PHP, Radio UserLand, Perl, Applescript and OS X.
RSS/XML Feed | scriptdigital.com | Picture | Search
Categories: AppleScript | BBEdit | Internet | Javascript | OS X | Perl | PHP | Python | Review | Radio UserLand
Technorati URL search for http://blog.scriptdigital.com.
Search Technorati for information relating to the URL or keyword of your choice.
... Original post: blog.scriptdigital.com: Emmanuel M Décarie's weblog on scripting. by at Daypop Search - filter replacement ...
Filter Replacement View Technorati URL search

RadioUserLand

Mon 17 May 2004

Frontier Kernel - Let Mark Alldritt build a product around it

I'm dreaming of Mark Alldritt using its Script Debugger base code to build a new product around the Frontier kernel designed first for OS X. Frontier over the years have unfortunately lost much ground as a scripting environment on OS X, and the UI is annoying to say the least to use on this platform. Although, I can script in AppleScript, I just found it excruciating and I rather script my stuff in UserTalk. I'm not talking of big server stuff here, just one the most elegant way I know to script OS X and the Aqua environment.

9:52AM EDT [ /RadioUserLand/Frontier | # ]

Fri 02 May 2003

Seth Dillingham: UserTalk: Articles and Essays

Seth has posted a page that regroup his articles and essays on UserTalk. If you are serious about programming Frontier or Radio UserLand, you need to bookmark this page. Seth Dillingham is certainly one of the best UserTalk knowledgeable person in the universe (he is funny too).

UserTalk: Articles and Essays by Seth Dillingham
http://www.truerwords.net/articles/ut/

You can also check his work around concerning the "root" keyword bug that I described here.
http://groups.yahoo.com/group/radio-dev/message/7794

comments: 0

4:22PM EDT [ /RadioUserLand/Dev | # ]

Wed 30 Apr 2003

Upstreaming Korean with Radio

Here's a page that show how to upstream Korean with Radio UserLand. In theory, you could use this technique for all double bytes languages like Chinese, Japanese, Korean and Vietnamese:
http://scriptdigital.com/divers/korea/kpage.html

It was inspired by a great hack by Lawrence Lee and posted on the Radio UserLand discussion group:
http://radio.userland.com/discuss/msgReader$24562

Lawrence emailed me about it and asked if I had "any comments/ideas". So here's my own contribution on the topic.

comments: 0

6:55PM EDT [ /RadioUserLand/Dev | # ]

Sat 19 Apr 2003

Radio and Frontier: Serious "root" keyword bug

The problem

Matt Mower have discovered a serious bug involving the word "root".
Reference: http://groups.yahoo.com/group/radio-dev/message/7755

If you have a version of Frontier greater than 5.0.1 or Radio , run this script.

local (t);
new (tableType, @t);
msg (sizeOf (t.root))

--> 7

This result is an expression of the bug and is explained by the fact that t.root point to root, and the root of Frontier.root or Radio.root contains seven tables (root.examples, root.scratchpad, root.suites, root.system, root.user, root.websites, root.workspace ).

Frontier 4.2.3 is not afflicted by this bug, and if you run the same script in 4.2.3 you will get this error:

Can't evaluate the expression because the name "root" hasn't been defined.

A worst case scenario

So Frontier 4.2.3 do the right thing, but not Radio and Frontier 5.0.1+. This is very dangerous. Here's why.

For my tests, I have created in Frontier 4.2.3 a root.websites table (its included in Frontier 5.0.1+ and Radio).

This script is inoffensive and will run well in 4.2.3 and 5.0.1. But don't run it unless you know what you are doing.

local (t);
new (tableType, @t);
new (tableType, @t.root)
new (tableType, @t.root.websites);
t.root.websites["site-1"] = "radionews";
delete (@t.root.websites)

Now, suppose that a step is missed in the script and t.root is not created. In 4.2.3 this will cause an error, but with Frontier 5.0.1+, and with Radio 8, root.websites will be deleted. I can't imagine the damage with a script using t.root.user or t.root.system.

WARNING: DON'T RUN THIS SCRIPT!
WARNING: DON'T RUN THIS SCRIPT!
WARNING: DON'T RUN THIS SCRIPT!

local (t);
new (tableType, @t);
// new (tableType, @t.root) // * missing step - t.root is not created *
new (tableType, @t.root.websites); // Frontier 5.0.1+ and Radio: overwrite root.websites
t.root.websites["site0001"] = "perlnews";
delete (@t.root.websites) // Frontier 5.0.1+ and Radio: root.websites deleted

With Frontier 4.2.3, the script will cause the following error because t.root point to the localized variable t and no t.root table have been created.

"Can't find a sub-table named root"

But if you run the same script in Frontier 5.0.1 t.root will incorrectly point now to root so t.root.websites will point to root.websites. The effect is dramatic, the faulty script will throw away the websites table.

My hunch tell me that this side effect is maybe related to the introduction of the guest databases.

Russel Gum have also noted that there is a problem with the work "stack".
http://groups.yahoo.com/group/radio-dev/message/7770

comments: 0

7:46PM EDT [ /RadioUserLand/Dev | # ]

Wed 19 Mar 2003

Best place for hooking into Manila site creation?

In response to Roland Tanglao post Best place for hooking into Manila site creation?

I'm a little bit rusty on Manila and I have a backlog on my email, so I don't know if somebody already answered Roland's question.

What one need to know is that Manila is build on top of the mainResponder framework. So sometimes you have to use the callbacks associated with mainResponder. Since mainResponder is also closely related to the old cgi framework that was before mainResponder, you have to look also at this framework.

Its unfortunate that some of the best documentation by Matt Neuburg that cover well this topic (the DrMatt pages on http://drmatt.userland.com) are no longuer available. If you ask on UserLand's mailing lists where are these pages, the UserLand staff will refer you to some cached pages by other services, which is against the will of the author. Its really sad that UserLand don't want to fix this problem and bring back this doc for Frontier/Radio developers.

Basically, you have some callbacks that kick-in before Manila start handling the request and others that are related to Manila.

For the callbacks that start before Manila, you have the ones that are supposed to be at user.webserver that run before the request is handled to mainResponder (IIRC). Be careful to understand that you might have no pageTable or a minimum pageTable if you run these callbacks. Then you have the callbacks that are associated with mainResponder at config.mainresponder.callbacks. From there, you might look at config.mainresponder.callbacks.controlAccess and config.mainresponder.callbacks.pathEvaluation.

And last but not least, you have the config.manila.callbacks.

One thing I remember developping on Manila is that its not easy to use redirect and handle the request before mainResponder get it because of the access control framework that pass the request early to Manila. You really need to familiarize yourself with mainResponder.respond which, IIRC, kick in and check to see early on if the request is to be handled to Manila (it will check for Manila cookies), so it will bypass some of the mainResponder callbacks.

One of the authority on Manila is certainly David Bayly. I also work as a consultant for Manila and Radio stuff.

comments: 0

10:01AM EST [ /RadioUserLand/Frontier | # ]

Sat 22 Feb 2003

shortWavesSuite.netNewsWire.createRadioShortcuts

I wanted to create Radio shortcuts from my NetNewsWire subscriptions. So I wrote this little script at shortWavesSuite.netNewsWire.createRadioShortcuts. It take the name and the home url of all subscriptions and create Radio Shortcuts.

To use it, you need first to download DuckTape.root from Sean Elfstrom which will allow you to create a NetNewsWire glue in Radio. Use "netNewsWire" when asked to enter the app name.

Then install or reinstall shortWaves.root 0.1.2 in the Tools folder of Radio UserLand. Select in Radio Tools->ShortWaves->NetNewsWire->Create Radio Shortcuts. Wait a couple of seconds, and you should see your personal shortcuts table filled in weblogData.root, and a copy of these new shortcuts in user.html.glossary.

comments: 0

12:47AM EST [ /RadioUserLand/Dev | # ]

Thu 20 Feb 2003

Radio UserLand: MailEdit 1.0b12, call for testers

Source: http://groups.yahoo.com/group/radio-dev/message/7476

   Date: Thu, 20 Feb 2003 17:21:14 -0000
   From: "David Brown" [email deleted]
Subject: MailEdit 1.0b12, call for testers

Greetings.  I have just released MailEdit 1.0b12 for testing.  As far
as I can tell, it's working, and as bug free as Murphy will let me see
right now.  I would like to invite anybody who is interested to
download it and try it out, and let me know what you think.

What is MailEdit?  MailEdit is a Mail-to-Weblog callback tool that
allows remote posting of entries to your Radio-managed weblog.  In
addition to the basic Mail-to-Weblog functionality built in to Radio,
MailEdit allows you to:

- add titles to your posts
- route a post to multiple categories
- edit a post after it has been submitted
- attach an image to a post
- recieve notification that a post has been completed

I've been using MailEdit to do almost all of the posting to my weblog
of late.  I post from the email system at work, and from my SideKick.

If you wish to be able to update your weblog from anywhere, MailEdit
is your tool.

It is available from
http://radio.weblogs.com/0100039/gems/mailEdit/mailEdit.root

As with all tools, download it to Radio's Tools folder, and wait for
Radio to notice it.  If you wish, restarting Radio should pick it up
immediately.

If you have already installed MailEdit, you may just use the "Refresh
Code..." command in the MailEdit tools menu.  If that menu selection
is not available, you should just download the tool from the URL above.

All necessary configuration can be done from the MailEdit prefs page,
available at http://127.0.0.1:5335/mailEdit/

Thanks in advance!

dave

comments: 0

2:11PM EST [ /RadioUserLand/Announce | # ]

Tue 11 Feb 2003

shortWavesSuite.drivers.ftp.upstreamToDirectory 0.1.1

Only minor changes to the documentation. The Windows path example was incorrect.

shortWavesSuite.drivers.ftp.upstreamToDirectory 0.1.1

comments: 0

10:50AM EST [ /RadioUserLand/Dev | # ]

Sun 09 Feb 2003

shortWavesSuite.drivers.ftp.upstreamToDirectory

The problem

I wrote this FTP driver for Radio UserLand after reading this post.

Does anyone know how to fool Radio into rendering all it's pages to the local drive, while maintaining proper link structure for the correct weblogURL?

I have a large OPML file -- ~300k -- that Radio just can't render and upstream via ftp. Maybe once in 25-30 attempts it works, the rest of the time it just upstreams part of the file. I'm not looking for some way to fix or force Radio to upstream this. I'm looking for some way to bypass Radio's ftp entirely.

I wrote back this after more feedback:

Maybe I could write a simple ftp driver that will, when encountering a specific #directive in the file, tell Radio not to upstream the file but write the file in the folder specified by another directive.

shortWavesSuite.drivers.ftp.upstreamToDirectory is doing just that. It will pass all files to the builtin Radio ftp driver beside those that contains the directive #shortWaves_upstreamToDirectory. In the latter case, (1) Radio will not upstream the file via FTP, and (2) Radio will write the file to the specified folder by the directive.

Download

Download ShortWaves Tool.

Installing

Decompress the archive and put shortWaves.root in your Tools folder in the Radio Userland folder. Wait a couple of seconds and go - in Radio UserLand - to the menu Tools->ShortWaves.

Installing Menu

Tools->ShortWaves->Install FTP Drivers

If a driver exists, the ShorWaves driver will not be installed.

Desinstalling Menu

Tools->ShortWaves->Desinstall FTP Drivers

This delete user.radio.upstream.ftp, so be careful with this command if you have already something there.

Usage

Write at the top of your file this directive and set its value to directory you want the file to be writed:

#shortWaves_upstreamToDirectory = "path:to:directory:" (OS X)

or

#shortWaves_upstreamToDirectory = "path\\to\\directory\\" (Windows)

Don't forget the last colon or backslashe because the shortWaves ftp driver will make no effort to add it.

By default, the shortWaves ftp driver will add ".html" to the suffix of the file. If you want another suffix, add also this directive (both directives have to be present):

#shortWaves_suffix = ".opml"

History

0.1.1

Minor changes to the doc. The Windows path example was incorrect.

First release: February 8 2003

Tested on OS X 10.2.3 with Radio UserLand 8.0.9b2.

comments: 0

4:13AM EST [ /RadioUserLand/Dev | # ]