zoukankan      html  css  js  c++  java
  • Using Javascript to display RSS

    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.

    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

  • 相关阅读:
    spring-cloud服务器雪崩效应
    zookeeper集群
    Hash表的扩容(转载)
    算法时间复杂度和空间复杂度的计算
    Java 8 新特性
    jdk8 流操作
    jdk8十大特性并代码demo(转)
    hashmap实现原理2
    hashmap实现原理
    Semaphore控制同时访问的线程个数countdownlatch等待多个线程执行完本身线程再执行
  • 原文地址:https://www.cnblogs.com/likehua/p/1965271.html
Copyright © 2011-2022 走看看