• Making RSS feed code with rails


    Method a:It is you who put together the RSS XML format and output it Set the HTTP header and mark the content type as application / XML. Common codes: Copy codeThe code is as follows: #Post_controller::feed() def feed require “rss” articles = Article.find :all, :order => ‘post_date DESC’, :limit => 10 feed = RSS::Maker.make(“2.0”) do […]

  • How to add RSS channel in MAC mail system to read some text


    Apple Mail is a utility in MAC. We can not only send mail through it, but also read some text channels through it. However, many users don’t know how to add these channels in Apple Mail, so today’s Xiaobian will teach you how to add RSS channels in Apple Mail. RSS is the abbreviation of […]

  • PHP regular expression analysis RSS


    Copy codeThe code is as follows: $xmlfile = ‘news/’.date(‘YmdH’).’.xml’; $sourcexml = ‘http://www.chinanews.com.cn/rss/scroll-news.xml’; if( !file_exists($xmlfile) ) { $STR = @ file ($sourcexml) or die (‘error loading file ‘);$FP = fopen ($xmlfile, ‘W’) or die (‘write cache failed! ‘);fputs($fp,$str); fclose($fp); Then use simplexml to read and output HTML Copy codeThe code is as follows: $xml = simplexml_load_file($xmlfile); […]

  • Implementation of RSS sample code for reading blog with Ajax


    Copy codeThe code is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <title>this is test</title> <script type=”text/javascript”> var xmlHttp; function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function readRSS(url) { createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open(“GET”, url, true); […]

  • Using Ajax technology to gather and display the latest articles of friends’ blogs


    Sometimes, your blog may need this function: Gather and display the latest blog articles of your friends on your blog, which is convenient for you to know your friends’ news in time. In addition, it is also convenient for visitors to find blogs and articles related to this blog. You can call this function “blog […]

  • WordPress Uses RSS Feed to Output Custom Article Type Content


    This article illustrates how WordPress uses RSS Feed to output custom article type content. Share for your reference. Specific analysis is as follows: WordPress supports RSS Feed output, but the whole site feed source only outputs posts. If you add custom article types, you need to add them to the whole site feed source of […]