How to Customize Google AJAX RSS

Numerous websites use Google’s Ajax code to collect and aggregate RSS news feeds from an external source, and display the feeds on a Web page.The Ajax RSS feed uses your CSS design file to control the appearance of the RSS feed text, but you can customize the feed settings to control which aspects of the feed's content display on your Web page.

Instructions

    • 1

      Launch your HTML editing program. Open the Web page that contains the Google Ajax RSS feed. The code for the feed will appear in the header section of the page, between the “<head>” and “</head>” code tags. It will also appear in the body section of the page, between the “<body>” and “</body>” tags.

    • 2

      Scroll to the Ajax code in the body section of the Web page, which is the only part of the code that you can customize. The customizable block of Ajax code will look like:

      <script type="text/javascript">
      var cssfeed=new gfeedfetcher("example1", "example1class", "")
      cssfeed.addFeed("CSS Drive", "http://www.yoursite.com?key=Bghggjrx") //Specify "label" plus URL to RSS feed
      cssfeed.displayoptions("date snippet") //show the specified additional fields
      cssfeed.setentrycontainer("li") //Display each entry as a list (li element)
      cssfeed.filterfeed(10, "date") //Show 10 entries, sort by date
      cssfeed.init() //Always call this last
      </script>

    • 3

      Type your preferred display option keywords between the quotation marks inside the brackets in the "displayoptions" code line:

      cssfeed.displayoptions("datetime snippet") //show the specified additional fields

      This element controls which parts of each RSS feed news item display on the page. The feed is set to show the date of the item, and a “snippet” that includes the feed item title and the introductory paragraph. Other valid keywords to use in this line include "time", "datetime", "label” and "description.” The “label” command shows the feed item label, while “description” publishes the entire RSS feed item. Enter your preferred combination of keywords into this line of code.

    • 4

      Enter your preferred formatting option between the quotation marks inside the brackets in the fifth line of code:

      cssfeed.setentrycontainer("p") //Display each entry as a paragraph (p element)

      This displays each RSS feed item as a list. Use “p” to show each item as a paragraph or DIV to treat an item as a separate page element division.

    • 5

      Change “10” in the sixth line of code to the number of RSS feed items that you want to display in the feed on the Web page. For example, change the feed to eight entries:

      cssfeed.filterfeed(8, "title") //Show 8 entries, sort by title

      The following “date” element instructs the page to show each RSS item in date order. You can change this to “title” to display RSS items by title, or “label” to organize the display by label.

    • 6

      Save the Web page and upload it to your website’s host server.

Related Searches:

References

Resources

Comments

Related Ads

Featured