![]() ![]() We have two hard-wired file names in the script. Having only one script kept everything in one place and made our debugging very easy. Because cron jobs simply discard browser output, it seemed fine to merge the functions of listing the directory and writing the RSS feed into a single script. Whenever the client added a PDF to the directory the audience would get an RSS update within a few minutes. And we set up a "cron" job that ran this index.php script every 15 minutes. We installed this script as the "index.php" script in the PDF directory. That change would trigger the writing of the new XML file that contained our RSS feed. If the new md5() string did not match the old md5() string, we had detected a change in the directory. Since we needed a way to know when the directory had changed, we decided to collect the list of files and make an In practice there was a little more styling than you will see here, but all the moving parts are the same. We set up a simple script to list the PDF files in its directory. So we built a PHP script to handle the RSS publishing. The investment company did not want to be bothered with the technical details of trying to create and store an XML string on the server. You subscribe to RSS feeds by telling the RSS reader what URL to follow. The reader gives you a "heads-up" if anything is new or changed. It reads the current XML file from each of those URLs and compares it to the older version of the file (if any). Whenever the clock expires, the reader goes to its list of URLs that point to RSS feeds. The typical design of an RSS reader is a small "system-tray" program with a time clock in it. And almost all web browsers can consume RSS feeds. svg.pngĪn RSS feed is usually consumed by an RSS reader program. g/wikipedi a/commons/ thumb/4/43 /Feed-icon. More information on RSS is available here:Īnd just for fun, the largest RSS icon I have ever seen is available here: We chose RSS because everyone at the meeting had heard of it, perhaps because it also forms the basis for podcasting. A competing standard, Atom, is quite similar. It carries only a few bits of information, such as a title, description and link. It was automated, and just low-tech enough that everyone could understand it.Īn RSS feed is simply a specialized subset of XML. So we arrived at the idea of an RSS feed. But that was the extent of their interest in the process they wanted automation to handle the rest. When the investment company released a publication, they made a PDF for print and they were willing to use FTP to place a copy of the PDF on their web server. And since attachments may not make it to a Blackberry something other than email seemed to be needed. We considered using broadcast email, but the client wanted something more automatic and less intrusive. The average demographic was male, 50 years old, using a desktop computer, and occasionally a Blackberry. Their constituents are mostly bankers and builders. Probably you would think "Facebook" or "Twitter" but this is an interesting client. * HttpClient to be used for loading feed content.įunction _construct($options = array()) elseif (in_array($attribute, array('0.92', '0.I recently had an investment company ask me how they might notify their constituents about their newsworthy publications. Support Custom CURL request, may be used to extends functionality through rayHttp class. By default SimpleXML is used as http client, Simple & Easy to use from anywhere in your application with a single line of code. Easily configurable & can work without any configuration. Can render html widget through optional RayFeedWidget class or your own extended class. Support pluggable html widget rendering class Detect feed type automatically, also can be set manually. Supports for RSS 0.92, RSS 2.0 and Atom feed It can auto detect feed type and supports RSS 0.92, RSS 2.0 and Atom feeds. All or any CURL options can be set for HTTP request. SimpleXML is used by default to load and fetch feed url but can be used CURL using rayHttp class. Html rendering functionality is provided through separate pluggable widget rendering class which can be extended easily. Usages are very simple and require only one line of code. This class is designed to provide quick access to any XML based RSS feed and it’s content. RayFeedReader, A Simple and Easy SimpleXML based feed reader class using PHP.įirst of all it’s another reinvention of wheel. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |