How to create an RSS feed and display it?

安稳与你 提交于 2019-12-11 04:26:53

问题


On a website I am maintaining for a radio station they have a page that displays news articles. Right now the news is posted in an html page which is then read by a php page which includes all the navigation. I have been asked to make this into and RSS feed. How do I do this? I know how to make the XML file but the person who edits the news file is not technical and needs a WYSIWYG editor. Is there a WYSIWYG editor for XML? Once I have the feed how do I display it on my site? Im working with PHP on this site so a PHP solution would be preferred.


回答1:


Use Yahoo Pipes! : you don't need programming knowledge + the load on your site will be lower. Once you've got your feed, display it on your site using a simple "anchor" with "image" in HTML. You could consider piping your feed through Feedburner too.

And for the freeby: if you want to track your feed awareness data in rss, use my service here.




回答2:


Are you meaning that someone will insert the feed content by hand?

Usually feeds are generated from the site news content, that you should already have into your database.. just need a php script that extract it and write the xml.

Edit: no database is used.

Ok, now you have just 2 ways:

  1. Use php regexp to get the content you need from the html page (or maybe phpQuery)
  2. As you said, write the xml by hand and then upload it, but i havent tryed any wysiwyg xml editor, sorry.. there are many on google



回答3:


Does that PHP site have a database back end? If so, the WYSIWYG editor posts into there then a special PHP file generates an RSS feed.




回答4:


I've used the following IBM page as a guide and it worked wonderfully: http://www.ibm.com/developerworks/library/x-phprss/




回答5:


I decided that instead of trying to find a WYSIWYG for XML that I would let the news editor continue to upload the news as HTML. I ended up writing a php program to find the <p> and </p> tags and creating an XML file out of it.




回答6:


You could use rssa.at - just put in your URL and it'll create a RSS feed for you. You can then let people sign up for alerts (hourly/daily/weekly/monthly) for free, and access stats.




回答7:


If the HTML is consistent, you could just have them publish as normal and then scrape a feed. There are programatic ways to do this for sure but http://www.dapper.net/dapp-factory.jsp is a nice point and click feed scraping service. Then, use either MagpieRSS, SimplePie or Feed.informer.com to display the feed.



来源:https://stackoverflow.com/questions/1613886/how-to-create-an-rss-feed-and-display-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!