Adding RSS news feeds
This document is based on a presentation made by Lorna Wong, UWW; Pat Fellows, UWC; and Allen Foley, UW-System. The process described here uses resources on the UWW web site.
Instructors can add RSS news feeds to D2L course tools, including News, Content, Widgets, Discussions, and others (Links, quiz questions, etc). To see RSS feeds used in each of the first four components logon to http://www.uwgb.edu/learntech/D2L/ (opens in a separate window) with the username and password of genstu21 and genstu. Go to the Demo Course in the Fall 2005 semester.
The following document describes the process of creating an RSS news feed in a D2L News item. The same general process is also used to create RSS feeds in the other tools in D2L.
To create the javascript code: Locate the desired RSS feed and copy the URL to the clipboard (Control+C). Go to http://omega1.uww.edu/feed2js/index.php (opens in a separate window) and paste the URL in the URL textbox. Click on the "check that it is valid" link (even links that don't pass the test usually work). There are several options that must be defined, each with a fairly good explanation. We recommend the following:
- Show channel? - yes
- Number of items to display. - Your choice but be advised that sometimes there are a lot to display. You might want to limit it.
- Show/Hide item descriptions? How much? - Usually 1, to show entire description.
- Use HTML in item display? - Usually no.
- Show item posting date? - Yes.
- Target links in the new window? - y = Yes.
- UTF-8 Character Encoding (advanced users) - Leave unchecked.
- Custom CSS Class (advanced users) - Leave blank.
Click on the Preview button to see the result of your choices. Make changes as you see fit. Click on the Generate JavaScript button to create the required code.
Adding the code to a News item: The Generate JavaScript button produces a textbox with two blocks of code, each no more than a few lines, separated by a blank line. The first block is bounded by "script" tags and the second by "noscript" tags. The second block contains code for those browsers that do not have JavaScript enabled. Since D2L requires that JavaScript be enabled this block of code can be ignored. (Note that including it will not cause a problem; it will simply be ignored within D2L.) Select all of the first block of code including the Script tags (or select all of the code with Control+A) and press Control+C to copy to the clipboard. Within a D2L course, add a News item. Check the In HTML box and paste (Control+V) the code from the clipboard. Add a Headline and remove the check by Show Date Available Beside Headline. Add whatever html code you wish to add and click Save. Do not open the HTML editor!
Never create or edit one of these items in the HTML editor! If the code for an RSS feed is opened in the HTML editor the code will execute pulling in the text for current items. That actual text will later be saved along with the code, with messy results. Because of this, editing RSS feeds in Content items is problematic since they open in the HTML editor by default. Content files should be downloaded, edited locally, and uploaded to overwrite the original file.
September 22, 2005
