Using Javascript to display RSS

來源:互聯網
上載者:User
Using Javascript to display RSS

I have written about using Javascript to display RSS previously. It seems people are still interested in the subject so I thought I would revisit the subject.

Javascript and RSS

First of I need to let you know that Javascript and RSS cannot be used exclusively to display a feed on your site. The reason for this is that the RSS feed needs to be parsed which involves extracting the data from the feed.

This means that a third language needs to be used such as PHP which requires a server to run the code. Javascript on the other hand is processed by your web browser. For this reason Javascript as a tool for displaying an RSS feed is considered a poor substitute for server side RSS processing using a language such as PHP

Javascript if you insist

On the plus side Javascript options for displaying RSS on your site are a quick and simple option. The reason for this is because someone else has done the hard work already.

First of all you will need to find a service that has done this hard work, here are sites that offer RSS to Javascript processing.

  • BlinkBits
  • RSS2HTML
  • RSS-to-Javascript
  • FeedSweep
  • RSS Xpress Lite
  • Feed2JS

The process is pretty simple, just let them know the RSS feed and the display options. You will then need to copy some Javascript that you will need to paste into your site and there you have your feed.

Benefits and cost

Whilst displaying an RSS feed on your site will provide you with some content and therefore some stickiness there are some downsides. You will be dependant on the service you have chosen being around, there will be downtime and the site may disappear altogether. You will not get and Search engine benefits as they cannot yet crawl Javascript.

Alternative to Javascript

If you prefer a more flexible and beneficial alternative the you could use PHP to parse and display your RSS feed. You will need some PHP knowledge for this but it is worth the effort.

SimplePie offers a free PHP class that does most of the hard work for you making it relatively easy to use your own web server to display RSS feeds. There are other more established alternatives such as Magpie and Carp but SimplePie offers good documentation and clear instructions.

Source from :http://www.newsniche.com/using-javascript-to-display-rss.php

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.