A river of Frontier news

We’re working on Frontier now more than ever, but the cursor has shifted from this WordPress site to sites using the new tools we’re developing.

At the center of everything is a river of Frontier news that’s subscribed to all the feeds. It’s the quickest way to find out what’s new.

http://frontier.blorkmark.com/

And there’s hellofrontier.com, which is an introduction to Frontier development in 2011.

And of course much of the info posted here is current and useful and not going anywhere.

When a “root” crashes

On the ec2-for-poets list, Michael Helleson writes:

“I’ve been getting errors with config.root during the nightly backup operations. It hasn’t been able to sucessfully back it up in a week or more. The size of the file in Guest Databases is over 700 megabytes.

“I attempted to do the filemenu.savecopy(“c:\config.root”) command and got this error.

A picture named crash.gif

“I checked in c: and there is no copy of config.root so I’m assuming the backup didn’t happen.

“I’m willing to let it go like this since River2/Blork still works just fine but I think if config.root gets much bigger it will be bad.”

What to do

This is a serious situation, do not let it go on. It may appear that everything is fine, but eventually you will lose the database.

1. Take your server off the air. Quit the OPML Editor.

2. If you’re running a Windows server, in the Task Manager app, force flaunch.exe to quit. This app may have been automatically launched by opml.exe. It periodically checks if opml.exe is running, and if not, it launches it. If you’re slow at this step you may have to repeat step 1.

3. Make a physical copy of the file that’s reporting the problem, in case something goes wrong with the recovery. Put the copy in a safe place, somewhere outside the OPML folder. The Desktop is where I usually put these files.

4. Re-launch OPML.

5. Bring the database with the problem to the front. Assume it’s config.root, as in Michael’s example.

6. Choose the Quick Script command from the Misc menu. This opens a small window that you can enter a script into.

7. Enter this into the Quick Script window: filemenu.savecopy (“C:\\config.root”) and press Enter. Wait.

8. If the script finishes, great. It was able to recover the database. But it probably didn’t.

9. If you got an error, it should have given you an idea where the problem is. In Michael’s case it was a sub-table of config.river2.feeds. Carefully navigate to that location in the database, and put the cursor on the problem table.

A picture named badspot.gif

10. Choose Copy Address from the Table menu.

11. Choose Quick Script from the Misc menu.

12. Enter table.jettison (@ then Paste then enter ) — and count to 10 then press Enter.

A picture named jettison.gif

This is an undocumented verb, used only in drastic situations like this one. Do not write scripts using it, because it doesn’t reclaim the space used by the object that is jettisoned. It’s safe to call in this situation because of that.

13. Immediately the bad bit disappears. (This happens instantaneously.)

14. Still in the Quick Script window, enter filemenu.savecopy (“C:\\config.root”) and press Enter. This should take a minute or so to run, and if that was the only problem in the database, it will run to completion without error. You can tell that it did because there’s a value in the bottom of the Quick Script window (screen shot) and there’s a file at the top level of the C disk called config.root.

15. Repeat steps 1 and 2 to quit the OPML Editor and flaunch.exe if it’s running.

16. In the filesystem, navigate to the location of the database that was crashed, and change its name from config.root to configCrashed.root. (If you get an error that the file is busy this probably means that OPML has re-launched. Repeat steps 1 and 2 until this works.)

17. Copy the saved file from the top level of disk C into the location of the crashed file. It should be considerably smaller. This is because all the unused space in the file has been “squeezed” out.

18. Relaunch the OPML Editor.

When this happens

You might wonder what causes a database to go bad.

It doesn’t happen very often, because the way the underlying code is written, it does all its work with a database quickly and doesn’t leave the file on disk in an invalid state. So when the program crashes, or if you force-quit it, almost always the data in the files are safe.

But occasionally the program crashes while it’s in the middle of writing out a critical resource, like the “avail list” or the items in a table. The database software that’s built into the OPML Editor complains if it finds something out of place. A “free” node where there should only be used ones. Or vice versa. This is an indication that a serious problem is coming soon. The data isn’t yet lost, but if you continue, it will be.

That’s why the first thing you must do when you notice the problem is to take a snapshot of the database, so if the problem gets worse you can try to recover from something better.

But knock wood, it doesn’t happen very often. But when it does, it pays to be prepared.

Bookmark this page

In all the years that the OPML Editor and its ancestors have been around, I’ve always meant to write one of these howtos. Now I have. When someone says they have this problem, point them to this page.

myPhotos.root archives your Flickr photos

myPhotos.root makes it easy (we hope) to create a backup archive of your photos from Flickr on the local file system and on Amazon S3. It also provides a testbed where we can play with new flows for pictures, once they’ve found a home outside Flickr.

Eventually we hope this will get a friendly browswer-based user interface. For now, you configure it by editing with the OPML Editor’s object database.

How to set up

1. Install myPhotos.root from the Tools Catalog page.

2. Wait a minute. Choose myPhotosData.root from the Windows menu.

3. Navigate to myPhotosData.users. Create a new sub-table with your username. It doesn’t have to be your Flickr username, but it’s fine if that’s what you choose. Wait a minute and the table will be initialized automatically.

4. Expand it. Then go into prefs, and enter your Flickr ID. (You can get your Flickr ID from this page. It’s in the right column, under Useful Values. Screen shot.)

5. It has automatically chosen a folder where it will store downloaded pictures. If you’d like them stored somewhere else, change the folder value. The three S3 prefs values are very important and hopefully self-explanatory.

6. Still in the user-level prefs table, set the enabled boolean to true.

7. Navigate to myPhotosData.prefs and set its enabled boolean to true.

What will happen

Once you flip the switch in the last step, at the top of the next minute, myPhotos.root will start downloading your pictures from Flickr, storing copies locally and uploading copies to S3. If you have a lot of pictures in your Flickr account, this could take hours to run.

If you quit the OPML Editor, next time you launch it, it should resume downloading where it left off, until it has downloaded all the pictures.

Once they’re all downloaded, it will start checking every ten minutes for new pictures. When it discovers that you’ve uploaded some, it downloads them and archives them on S3.

So Flickr remains a good way to publish your pictures.

CSS in worldOutline.root

Yesterday I worked closely with Dave Jones on making the worldoutline themable. The result is fairly magnificent. The tables and blockquotes are gone. Yet it all looks great, and designers can have their way with the way outlines are displayed.

All this involves some fairly major changes to the code that implements html directories, and to the templates that are used to generate them. If you’re running worldOutline.root, you should follow these steps carefully to make this corner-turn.

How to update

1. Choose Update opml.root from the File menu.

2. Bring worldOutline.root to the front and choose Update front Tool from the Tools menu.

3. Bring config.root to the front and navigate to worldOutline.prefs. If you’ve made changes to your templates, add “Old” at the end of their names, otherwise delete them. template and directoryTemplate. In a minute or less they will be automatically replaced with “virgin” copies that are designed for the new code.

That’s it.

How to control appearance

1. You can do it the obvious way, by adding a <styles> section to the <head> of the main template or link to an external stylesheet.

2. You can also use the OPML Editor’s Add Styles command (in the World Outline sub-menu of the Outliner menu). It’s explained in this howto.

3. There are more ideas we are exploring.

Styles, the worldoutline and OPML Editor

You can add styles to your worldOutline. And when we make the templates more style-friendly, which should be a quick bootstrap, that will mean you will be able to completely redesign the look of a hierarchy from within the OPML Editor.

How to

Here’s how it works, revealed in layers (as you’d expect since all this stuff cascades)…

1. To see what styles you can set, do a view-source on any page in a worldOutline server you can author for. One where you are either the author of the root outline, or one of your outlines has been included within the root outline, either by the author or one of the people he or she delegates to.

2. In the OPML Editor, add a style to any headline, by choosing the Add Styles command in the World Outline sub-menu of the Outliner menu. The styles are anything that can appear in the <style> section of the <head> section of an HTML document.

The styles accumulate in a hierarchic manner, with the outer styles appearing before the inner styles. That is, the inner styles can override the outer ones. Exactly as you’d want it to work.

3. When you save the outline, the new version of the outline is displayed. When you visit a page that is subordinate to a style or a collection of styles, they govern the appearance of the page, as any other styles in HTML would.

We’ve started a group project with this blog post on Scripting News. Since you have detailed knowledge of how the worldOutline app works, and presumably are running it on your server, here’s an additional hint.

4. There are two templates that you can edit that control how themable your worldOutline is. They are at: config.worldOutline.prefs.directoryTemplate and config.worldOutline.prefs.template.

You can add classes to HTML elements in either of those templates and that will allow authors to add styles to control their appearance, using the OPML Editor, as described above.

Demo

body {color: #DC143C; font-size: 95%;} — this is the styles attribute of the demo headline.

body {color: #008000; font-size: 105%;} — this is the styles attrbiute of the New York headline.

To see how it works, you have to do a View Source on the New York City page.

You’ll see the <style> element in <head> has two items in it, and the latter one overrides the former one.

That’s why the text is green and a little larger underneath New York City.

Obviously this is just the beginning. Next thing to do is to re-do the templates so that everything has proper classes on them, and the tables should go away as the layout mechanism.

If you have questions, ask them here or on the EC2-for-Poets mail list.

dnsApi.root, interface to dnsimple.com

dnsimple.com is a domain name service that has an API.

dnsApi.root connects to it, providing a simple XML-RPC interface for creating, updating and deleting names.

The OPML Editor uses dnsApi.root to help implement the domain-mapping feature of worldOutline.root (and other features in the future).

How to install

1. You must be running the Windows version of the OPML Editor on your server, and have an account on dnsimple.com and be running a copy of worldOutline.root.

2. From the Tools Catalog page click the Install link next to dnsApi.root.

3. Relaunch OPML Editor. Wait a minute.

4. Jump to config.dnsApi.prefs. Enter your dnsimple.com username and password. Set enabled true. Wait a minute.

5. You should see your dnsimple-hosted domains show up in config.dnsApi.domains, and any records you’ve already established under that in each domain’s records table.

6. Then you can go into your OPML Editor user.opmlEditor.prefs.dnsApiServer to point to your server.

How to customize the look of your Blork

Have you been using Blork, but found yourself wanting to change its look and feel? Well, you can!

If you look the Prefs area, you’ll see a “Look & Feel” section that has a link to “Custom CSS.” Clicking that link will take you to a prefs page where you can extensively customize the look and feel of your Blork pages using CSS.

If you’re comfortable with CSS and you’re ready to get customizing, this is what you do.

  1. Click on the “Prefs” link in the Blork menu. Then click on the “Custom CSS” link in the “Look & Feel” section.
  2. On the “Custom CSS” page, you’ll see a text box containing the default CSS for Blork. You can make any changes you want in this box, then click the “Submit” button at the bottom of the page.
  3. Reload the page or click on one of the links in the Blork menu, and you’ll see your changes. VoilĂ !
  4. If you completely break everything, or you just want to get back the default CSS, you can simply go back to the “Custom CSS” page, clear the text box containing your custom CSS, then click the “Submit” button. Reload the page or click on one of the links in the Blork menu, and the default CSS will be reloaded.

For example, one small yet dramatic tweak you could try would be to add the following to the bottom of the default CSS:

body {
  font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
  font-size: 120%;
  }

See? Now, show us what you’ve got! :-)

worldOutline.root, a simple shell

Way back in 2002, at UserLand we did something smart by extracting the core of the OPML directory browser and putting it into the core set of verbs. The code survives to this day, and it works!

It took a couple of hours to put together a simple website shell, in a Tool, worldOutline.root.

I had to make one small change in the core code to get it to work properly in the new context. So you need to update opml.root for this to work. There may be other fixes needed later.

This tool is for people with experience running an OPML Editor server.

How to install

1. You need to be running the OPML Editor.

2. From the Tools Catalog page click the Install link next to worldOutline.root.

3. Reserve a sub-domain for the outline, and add an item to config.mainresponder.domains pointing that domain to @worldOutlineWebsite.

4. Navigate to config.worldOutline.prefs.rootOutlineUrl. Change it to point to the outline you want to serve as your root. Recommend using the Dropbox public folder for this outline.

There’s still some more work to do, so stay tuned.

You can browse around my website at http://worldoutline.scripting.com/.

Setting up beaut.root

Beaut.root sits on top of radio2.root and river2.root providing an integrated user interface, one which supports reading and writing of news. So to do this installation, you must already have radio2 and river2 installed and running on your server.

How to set up

1. On the server, choose Tools Catalog from the Misc menu. Click on the Install link next to beaut.root. Click OK to all confirmation prompts.

2. Think about what domain you want to map to the Beaut website. At your registrar, point that domain at your server. Then choose Set Domain from the Beaut sub-menu of the Tools menu. A dialog appears. Enter the domain and click OK. It will set also set the cookie domain in members.root. (An aside: If you’ve been running Radio2, you might just want to map that domain to Beaut, to keep it simple for your users. This user interface is a superset of the Radio2 interface.)

Unless I’m missing something, that’s it. :-)

BTW, it’s called beaut.root because it was built around what we call the “beautiful” river interface. I didn’t want to type beautiful for every routine I needed to call, and variable I wanted to access, so I shortened it to beaut.

Setting up radioReallySimple.root

Last weekend I decided it was time to throw in the towel on my vow to not write any more Twitter apps, and wrote a simple app that does what TwitterFeed does. It creates a connection between feeds and Twitter accounts. Why? TwitterFeed is great, but it can take up to 1/2 hour for it to push an item from a feed to Twitter. In a real-time world, that’s too slow for some applications.

So I wrote what I thought of as a Fractional horsepower TwitterFeed. It could never carry the load that TwitterFeed does, it wasn’t designed to. But it can follow a couple hundred feeds with an average of five minutes between the time it was posted to the feed and the time it appears on Twitter. Further if the feed supports rssCloud, there is almost no wait. At most a few seconds.

How it works

1. Install a copy of radioReallySimple.root on your server, and then configure your copy of Radio2 to link to it. There will be a little blue Twitter icon under the edit box. When you click on it, it will connect to your radioReallySimple.root server.

2. A page loads on your radioReallySimple.root server, but almost immediately it redirects to Twitter’s OAuth page. If the user grants permission to write to his or her Twitter account, the connection is then set up on your radioReallySimple.root server.

3. When the feed updates, radioReallySimple.root detects it, and posts the new items to Twitter. Just leave it running.

To the user it appears as if Radio2 is talking directly to Twitter, even though there’s an intermediary.

How to set up

1. From the Tools Catalog page click on the Install link next to radioReallySimple.root. Click on OK to all confirmation dialogs.

2. Log on to your Twitter account. Choose Settings, then Connections. Screen shot.

3. In the right margin you’ll see a section for Developers, click the link to visit the Apps page.

4. At the bottom of the page is a link to Register A New Application. Now you have to come up with a name and a description. You can change this alter, but your users will see this, so try not to scare them. For the application website, you might want to write a blog post and link to it there. Your Application Type is “Browser.” The Callback URL is http://yourdomain.com/callbackFromTwitter where “yourdomain.com” is the domain you’re going to map to the website (in step 7 below). Your Default Access Type is Read & Write. You are not using Twitter for login.

5. After you register your application you’ll see a page with several strings on it. You’re going to copy those strings into the config.root. They identify your app to Twitter. In this screen shot I’ve hidden the strings for my app.

6. In the OPML Editor, navigate to config.radioReallySimple.prefs.oAuth. I’ve set up the URLs for you, but over time they might change, so read the page on twitter.com carefully to be sure. Then copy the fields from the twitter.com page into the prefs table, carefully. This information is essential for communicating with Twitter.

7. Again in the OPML Editor, navigate to config.mainResponder.domains, and enter the domain name for your radioReallySimple.root app in the first column and @radioReallySimpleWebsite in the second. Test the domain in a browser to be sure you can get there.

8. Finally on the machine that’s hosting Radio2, navigate to config.radio2.prefs.domainRadioReallySImpleApp and change it to point to your server.

With any luck you’re now in business. :-)

Follow

Get every new post delivered to your Inbox.