River2 Blog

News and updates about the River2 aggregator.

JavaScript includes in River2

See the earlier piece for a tutorial on what JavaScript includes are and how they work.

Today there’s a new feature in River2. If you have the Dropbox feature turned on, in addition of generating a static HTML page, River2 will also generate a JavaScript include file (index.js) and an OPML subscription list (index.opml) in the same folder as the HTML file. The screen shot below illustrates:

A picture named dbfolder.gif

The OPML subscription list, index.opml, is of obvious value — it makes it possible to share your list with other users. It also backs up your list in a place that’s automatically synched with your other computers.

The JavaScript include file, index.js, file lets you include the result of the aggregator in another website. We’re going to use it as part of the nyblogs.org project to include the news in a WordPress weblog.

For an example of how it works, do a View Source on this page:

http://scripting.com/misc/includeDemo/

There are basically two moving parts — the stylesheet and the <script> that includes the .js file.

If you look in the stylesheet, you’ll see it defines styles specifically for River2. You can either copy the contents of the stylesheet, or if you have CSS skills, you can customize the look of the river when it appears in your site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.