Headlines Plugin


Table of Contents

Chapter 1. Introduction

This plugin allows you to view the content of any RSS, RDF or Atom XML data feed on the net within jEdit. This includes a great many blogs and news sites including Slashdot, Metafilter, CNet, Freshmeat.net, Salon, and many more. New in 1.2, you can also author and post entries to your blog that supports the Blogger or MetawebLog API.

Chapter 2. Features

  • Should be compatible with any RSS, RDF, or Atom content feed.

  • Can post to blogs that support the Blogger API or the MetaWeblog API.

  • Easy to setup. Just feed the URL to the option panel and it figures out the name and description of the feed.

  • Assign shortcuts to common actions like showing the next/previous feed and refreshing the current feed.

  • Data is cached for a configurable amount of time to avoid unecessary refreshes.

  • Configurable display options

  • Content can be extracted to a buffer in plain text form or XML.

  • Uses the Infoviewer plugin to enable hyperlinking to articles.

Chapter 3. Usage

Reading feeds

The user interface consists of a toolbar with a refresh button, a drop down list of all available feeds, and the content area. Clicking the refresh button will refresh the currently visible feed. While loading, the refresh button will temporarily change to a cancel button. Choosing a new feed automatically switches to and refreshes the selected feed.

The first line of the content area displays how old the cached feed is. If the feed is fresh (was just retrieved from the server) then the line will read "Content refreshed". Otherwise, it indicates how old the cached data is. Below that line, content for each article is displayed. If an article includes a hyperlink, clicking the article will launch a web browser according to your Infoviewer plugin settings.

Feed management

Add a new feed:

  • Open the Global Options and click on the Headlines plugin.

  • Type or paste the URL of the feed into the Add New Feed box.

  • Click the Add button.

  • The feed will be retrieved. If it is valid you will be prompted to confirm adding it.

  • Once confirmed, the feed is added.

  • If the feed was not valid or could not be retrieved, an error message will appear indicating the problem.

  • In case of an error, you will be given the option of adding the feed anyway (maybe the site was temporarily offline). You can update the feed details later using the Update feature.

Delete a feed:

  • Select the feed you want to remove from the list in the Existing Feeds box.

  • Click Delete. You will not be asked to confirm the delete so be sure you really want to do it.

Update existing feeds:

  • Over time, feeds may change their names or descriptions or you may have attempted to add a feed that was invalid in the past and you want to see whether it is valid now.

    • To update a single feed, select the feed and click Update.

    • To update all feeds, click Update All.

Options

  • Cache lifetime (seconds): When you view a feed for the first time, it is downloaded and stored locally. From that moment on, you will see the cached version everytime you view or refresh that feed. Cache lifetime is the amount of time (in seconds) that the feed will remain cached since it was originally retrieved. Once the cache expires, a refresh will download a fresh copy of the feed and re-cache it again. It is recommended that this feature retain a semi-high value (e.g. 1800 seconds) since: a) most RSS/RDF feeds don't update very quickly anyway and b) many sites put a restriction on how often one should access their RSS/RDF feed.

  • Remove HTML tags: If checked, removes HTML markup from articles. This makes the dispaly of the content cleaner and consistent and it allows the Description limit option to function optimally.

  • Sort feed list: If checked, the feeds will be sorted alphabetically in drop down lists.

  • Divider between items: If checked, a horizontal divider will be drawn between each article.

Posting to your blog

Posting to blogs works but should be considered an experimental feature at this point. It has only been tested with a small set of blogging systems. Please let me know if you encounter problems using this plugin with your blogging service and I'll try to get it fixed for the next release.

Different blogging systems support different formats for a post. This plugin supports two major blogging APIs (Blogger and MetaWeblog) but just about every implementation of the API is unique and many vendors have added their own extensions. Consult your blogging service documentation for information specific to your service.

To post to a blog using the Blogger API:

  • First, create a new buffer in jEdit.

  • Enter your post in the buffer. Some services support special tags in the post for things like the title and category and others don't (consult your service documentation for details).

  • From the Plugins | Headlines menu, choose Post or Post and Publish. Post will save the post as a draft; Post and Publish will publish your post to your blog so that your audience can see it.

  • If you have more than one blogging service configured, you will be prompted to select one to send the post to.

    After that, if your blogging service allows you to have more than one blog, you will be prompted to select the blog.

  • If everything worked you will see a Blog Updated message. If there was an error, an error message will be displayed.

To post to a blog using the MetaWeblog API:

  • Posting using the MetaWeblog API is identical to the Blogger API except for the format of the post.

  • The first line of the buffer is always used as the title of the post. The second line of the buffer is always used as the category. The rest of the buffer is the content of the post.

Editing or deleting a post

  • To edit or delete a post you must first select the post you want to edit or delete. Choose the Plugins | Headlines | Get last post or Get recent posts menu option.

  • You will be prompted for the blogging service and blog (if more than one is configured).

  • If you chose Get last post, the most recent post will be retrieved into a new buffer. If you chose Get recent posts and there is more than one post available, you will be prompted to choose from the 10 most recent posts to your blog.

  • The post will appear in a new buffer. The format will vary depending on the blogging service.

  • When you are ready to save your post, choose Post or Post and Publish from the Plugins | Headlines menu. If you want to delete the post, select Delete post or Delete post and publish. The buffer remembers where the post came from so you will not be prompted for the service to save the edited post to. You can discard the buffer or continue making changes and Post again if desired.

Blog management

Add a new blog:

  • When you go the Blogs option pane for the first time, there are no blogs listed. Enter the appropriate information for your blog (consult your blogging software for help). For example, for Blogger you would use:


                            Host:     plant.blogger.com
                            Port:     80
                            Endpoint: /api/RPC2
                            API:      Blogger
                        

    You may use any name you wish; and of course your logon credentials. You do not need to store your password here. If the password field is left empty, you will be prompted for it when you access your blog. This is recommended because the password is stored in the blogs.xml file in clear-text.

  • Click Save to save your blog information.

  • To add another blog, click New and enter the information. You must use a unique name for each blog otherwise the existing entry will be updated with the new information (you cannot have two blogs with the same name).

Delete a blog:

  • Select the blog you want to delete.

  • Click Delete.

Update a blog:

  • Select the blog you want to update.

  • Update the information and click Save. If you modify the name, a new blog entry will be created with the new name.

Chapter 4. Where to find content

Headlines comes with some popular feeds built-in. There are literally thousands of blogs and news sites that publish their content as RSS or RDF feeds. Some good starting points:

http://radio.weblogs.com/

http://www.weblogs.com/

http://blo.gs/

Appendix A. To do list:

  • Fix focus in the password dialog

  • Add support for the Atom API for posting to blogs

  • Highlight new entries since last refresh

  • Auto-refresh interval

  • Spider all blogs and notify when updated

  • If you have any ideas, send them to headlineplugin@flagrantdisregard.com.

Appendix B. Known bugs

This isn't really a bug but it can be perceived as one. Sometimes sites are sloppy about how they create their RSS feeds. Since XML is touchy about illegal characters and missing tags, a feed that loaded fine yesterday might not load today. I'm working on ideas for preprocessing the XML data to help Headlines at least read SOME of a malformed feed. In the meantime, complain to the site owner that they are generating bad XML.

Appendix C. License

This plugin is licensed under the GNU General Public License and comes with ABSOLUTELY NO WARRANTY; for details see the full license. This is free software, and you are welcome to redistribute it under the terms and conditions described in the license.

Appendix D. Change log

Jun 26 2004: 1.2

  • Added preliminary support for Atom feeds.

  • Added preliminary support for posting to blogs. Supports the BloggerAPI and the MetaWeblogAPI.

  • Fixed bug where the option pane would stop working if you deleted all feeds.

Mar 12 2004: 1.1.3

  • Remembers the location of the divider between the story list and the summary.

Jan 20 2004: 1.1.2

  • Scrolls automatically to keep the selected story in view when using next/previous story keyboard shortcuts.

Sep 21 2003: 1.1.1

  • Implemented the deferred loading API for faster jEdit startup times.

  • Removed the "Hide Description" option which was obsolete since 1.1

  • Added new actions to move to the next/previous story within a feed. You can now do everything via the keyboard.

  • jEdit 4.2 or higher is now required

Jul 15 2003: 1.1

  • Switched to a two-pane view with titles in one pane and content in the other. This interface is cleaner and avoids some complications with the old inline style.

  • Added text "No title" if the RSS entry has no title.

  • Added text "No date" if the RSS entry has no date.

  • Added text "No content" if the RSS entry has no description.

  • The Java HTML renderer doesn't seem to like tags like <... /> so /> is replaced with simply > in each RSS entry description.

  • Description limit option is now obsolete so it was removed.

  • Looks for dates in each RSS entry more aggresively.

  • Added Next|Previous buttons to the UI.

May 02 2003: 1.0.4

  • Made saving XML data a two-stage process so it won't corrupt the config file.

  • Changed save implementation so that it doesn't attempt to use the JAXP XSLT. This should resolve some issues with ClassCastExceptions.

  • Fixed a bug that would prevent cache files from saving and the option dialog to look odd if tabs and carriage returns/line feeds were used in the <name> or <description> elements in the feeds.xml configuration file.

  • Fixed max description length for HTML in the feed when "Remove HTML Tags" option is unchecked. Note that things like <br> tags, images, and the like currently do not affect the height of each story "panel".

  • Fixed bug with next/previous (it was starting and then stopping the refresh thread immediately)

  • Added some logging to the jEdit activity log.

Apr 08 2003: 1.0.3

  • Refresh button changes to Cancel during a refresh.

  • Fixed bug where adding a new feed would corrupt the config file if the feed description was missing or empty.

  • Improved error trapping when adding a new feed.

Jan 11 2003: 1.0.2:

  • Added menu option to open the Headline window.

Jan 9 2003: 1.0.1:

  • Wasn't creating the headline settings folder on the first invocation after install. I never saw the problem because I already had a headline folder setup.

  • Added http://community.jedit.org/backend.php as a default feed.

Jan 8 2003: 1.0: initial release

Appendix E. Format of feeds.xml

This file in the jEdit settings /headline directory contains connection data for each of your subscribed feeds. This file is maintained via the Global Options. Do not edit this file directly unless you know what you are doing.


<feeds>
<feed>
<name>Salon.com</name>
<url>http://www.salon.com/feed/RDF/salon_use.rdf</url>
<description>Salon makes you think.</description>
</feed>

<feed>
<name>Slashdot.org</name>
<url>http://slashdot.org/slashdot.rss</url>
<description>News for nerds, stuff that matters</description>
</feed>

...
</feeds>

Appendix F. Format of blogs.xml

This file in the jEdit settings /headline directory contains connection data for each of your blogs. This file is maintained via the Global Options. Do not edit this file directly unless you know what you are doing.


                <blogs>
                    <blog>
                        <blogname>my blogger blogs</blogname>
                        <host>plant.blogger.com</host>
                        <port>80</port>
                        <endpoint>/api/RPC2</endpoint>
                        <username>username</username>
                        <password></password>
                        <api>BloggerBlog</api>
                    </blog>
                    ...
                </blogs>