Showing posts with label RSS. Show all posts
Showing posts with label RSS. Show all posts

Sunday, August 14, 2011

How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible)

In this tutorial, I demonstrate how to generate a feed using Php that can be displayed from a website in multiple formats, including Atom 1.0 and RSS 2.0.  I will be using functionality from the Php FeedWriter class library to generate the feed, which is available for free at http://phpFeedWriter.webmasterhub.net/.

I have broken up the process below into separate components, and provided additional information to help you learn each aspect of creating the feed using Php.  A download of the completed script written in this tutorial is also provided if required.

Summary

  • Prepare your feed script/page - Instantiate a (Php) FeedWriter Class Object
  • Add additional (Channel) data to the feed
  • Add Items to the Feed
  • Get the specified feed output format
  • (Optional) Set the “Content” element of each feed item as type “HTML”
  • Output the Feed XML
  • (Optional) Writing to a file / Caching Feed Content

Wednesday, June 29, 2011

Php FeedWriter Released - Version 3.0 Beta - Universal Feed Generator

Generate Atom 1.0, RSS 2.0 and RSS 1.0 feeds for free using Php.


Php FeedWriter 3.0 beta has been released for download.  The update to the class and functionality builds upon the previous version RSS2Writer v2.1, which limited output to an RSS 2.0 compatible feed only.
Php FeedWriter 3.0 now supports multiple feed formats: Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91.  Php FeedWriter povides a set of easy to use functions to handle both feed input and output.

Tuesday, August 31, 2010

Php RSS 2 Writer Update (v2.1) - CDATA Enabled

The Php RSS 2.0 Writer class has been recently updated to include the option of writing CDATA in the RSS feed item title or description components. This allows the feed to be parsed even when the content within a feed item contains special characters that would usually be parsed as an XML element, such as HTML code. When the xml parser reaches a CDATA tag, the content within will be ignored, allowing special characters to be included in the content. Please note that you are still required to encode any special character that appears in a CDATA tag, which is commonly '<', '>' and '&' characters.

View more details about the update and the Php RSS 2 Writer class file. Further information is also available ablut the recent updates to the class as well as general usage information for the class. The class file and sample constructor is also available for downloaded on this page.

The CDATA update was prompted by an issue someone was having when trying to generate an RSS Feed using the class. View the RSS Feed CDATA Troubleshooting post.

[Update: The Php RSS 2.0 Writer class that this post refers to has been upgraded, and has also moved to a dedicated site.  The updated package is now Php FeedWriter, which supports output of multiple RSS formats and also Atom 1.0.  A tutorial is available on this blog to help with: Creating a custom feed using Php FeedWriter.  A link to download the package for free is available from the post also. ]

Wednesday, August 25, 2010

RSS Feed CDATA Troubleshooting

RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://PhpFeedWriter.WebmasterHub.net/

Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds

View more information about Php FeedWriter, including online documentation.  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released.

A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog:
How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible)



RSS Feed CDATA was not working properly in the Php RSS 2.0 Writer class when trying to generate an RSS feed, as CDATA was not initially supported by the class. When the CDATA tags were included using '<![CDATA[' . $content . ']]>' as the value in the description element of the field, it didn't work.

Saturday, January 9, 2010

Php RSS2Writer (v2.1) - Generate RSS 2.0 Feed - Usage Instructions & Download

RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://phpfeedwriter.webmasterhub.net/

Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds

View more information about Php FeedWriter, including online documentation.  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released.

A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog:
How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible)




Generate RSS 2.0 Compatible feeds in Php, using the Free Php RSS2Writer Class.

The Php RSS2Writer class has been updated. Recently implemented v2.1 updates allow CDATA to be incorporated if required. Version 2.0 included improved usability when using the RSS2Writer class to generate an RSS Feed from website or database content, as well as additional functionality required to generate valid RSS 2.0 Feeds. Usage instructions for the class are below.

Download Php RSS2Writer - Version 2.1
The download page also provides some additional information about the class and sample controller.


Saturday, May 23, 2009

XML-RPC Blog Ping

I am developing a Php script which uses the Weblog_Pinger class written in php by Rogers Cadenhead. The script currently logs all pings to a MySQL database table, but is controlled using a single php script which calls the ping_ping_o_matic function for each site. I noticed that once more than about 20 sites were being pinged, the script sometimes timed out.

Instead of adjusting settings in php.ini or the web server, I decided to implement the Weblog_Pinger class with a controller which uses a MySQL database to store addresses to servers which support XML-RPC pings. The database will also store details of the blogs / rss feeds being submitted. When commencing the bulk ping, a dialog will allow a selection from the list of blogs / rss feeds, and the "changes url" for each selection to be specified. The php interface will also allow XML-RPC servers and additional blogs or rss feeds to the database.

Monday, April 13, 2009

Free Php RSS 2.0 feed generator class (RSS2Writer)

RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://phpfeedwriter.webmasterhub.net/

Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds

View more information about Php FeedWriter, including online documentation.  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released.

A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog:
How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible)



[Edit: 9th January 2010]
This Class has now been updated to Version 2. The information provided in this post is now out of date. Please see the Php RSS2Writer Class page for information about the updated version (Version 2.0).

Updated Version (2.0): Php RSS 2 Writer - Download and Usage Instructions

Understood
This website is using cookies. More details