Showing posts with label XML Generator. Show all posts
Showing posts with label XML Generator. Show all posts

How to Generate an RSS Feed using Php



Update 14th Aug 2011:
 The information in this post is for the RSS2Writer Class, which has since been updated to Php FeedWriter.  Php FeedWriter supports output in multiple formats, including Atom 1.0, RSS 2.0 and RSS 1.0 (RDF). Online documentation is available to help with using the class library to generate RSS or Atom Feeds.

Generate RSS Feed using Php FeedWriter

The latest version of Php FeedWriter can be downloaded for free from the Php FeedWriter Website
http://phpfeedwriter.webmasterhub.net/


The following describes how to generate an RSS 2.0 compatible feed from a Php Script. the process utilises the free Php RSS2Writer Class written by Daniel Soutter. Examples are provided to create an RSS feed that includes optional information such as copyright, author, and channel/item categories. The Class allows the RSS Feed XML to be rendered by a browser or RSS Reader, as well as the option to output the RSS feed to a file if required.

For more detailed information, usage instructions and a free download of the RSS2Writer Package containing the class file and sample controller, see Php RSS2Writer (v2.0) - Generate RSS 2.0 Feed - Usage Instructions & Download.

Generate an RSS Feed using the Php RSS2Writer Class:


1. Include and initiate the RSS2Writer Class

require_once("RSS2Writer.php");
$rss2_writer = new RSS2Writer('Feed Title', 'Feed Description', 'feed url');

2. Add additional information to the Feed Channel

$rss2_writer->addElement('copyright', '(c) Daniel Soutter 2010');

3. Add Items to the Feed

$rss2_writer->addItem('item title', 'item content/description', 'item url');

3.1 Add Additional information to an item (most recent)

$rss2_writer->addCategory("Free Php Script");
$rss2_writer->addCategory("RSS 2.0 Feed Generator");

4. Output the RSS 2.0 compatible Feed XML

echo $rss2_writer->getXML();


When the php script is accessed using a web browser, the result will be an RSS 2.0 compatible feed, which can the be subscribed to, or submitted to search engines as a site map.

Note: To add additional information to the feed channel, you need to call the addElement / addCategory functions before adding items to the feed. To add additional information to a specific item in the RSS feed, call the functions after adding the items to the feed. The additional elements will be added to the item most recently added to the feed.





-----------------------------------------------
Php Generate RSS Feed
Free Download Php RSS Writer
Generate RSS Feed using Php

Programming Tools: Free Code Generators


Categories > Programming Tools > Code Generators


Data Generator
Data Generator is a free script written in JavaScript, Php and uses MySQL for the database. It offers a comprehensive set of options to create large amounts of custom test data to populate database fields when testing a website or web application.


CSE HTML Validator Lite - FREE HTML Editor and HTML Checker for Windows
Edit and validate HTML, CSS, JavaScript, PHP, links, accessibility, and more using CSE HTML Validator Lite. Other features include spell checking, bulk test case change to lowe-case in all HTML tags. Includes a template tool to create headers and footers for pages on a web site.


Online XML Schema Generator
A free online XML schema generation tool. Raw XML or a hyperlink to an XML document can be supplied to the interface which is then processed to generate an XML schema based on the supplied XML.


Htaccess Disable Hotlinking Code Generator
Generate a .htaccess file to stop people from hotlinking directly to images on your web server. Reduce and save bandwidth.


HTML Code Generator
Generate the HTML for a a basic web page using this HTML Code Generator. Fields are provided to enter information required to generate metatags for the head section, as well as setting styles for the page.

Categories > Programming Tools > Code Generators
 
|  WebmasterHub.net Blog. Blogger Template By Lawnydesignz Powered by Blogger