473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

help on integrating RSS in site done in php

hi guys,

i want to have rss on my site and the page is written in php
(mypage.php). what are the things i need? how to start to with it?

pls help..
tnx

Apr 30 '07 #1
1 1541
shotokan99 wrote:
i want to have rss on my site and the page is written in php
(mypage.php). what are the things i need? how to start to with it?
Try my feed library...

http://svn.sourceforge.net/viewvc/de...ss?view=markup

Example of usage:

<?php

// This file is called "http://example.com/feed.xml"

// Load up the Feed library.

require 'Feed.class';

// Create a new feed.

$f = Feed::factory(
'rss2',
'Example.com News',
'http://example.com/feed.xml',
'All the latest news and greatest views from Example.com',
'en' #English
);

// You would normally want to read your news from a database and
// add each item to the feed. However, for simplicity I'll add a
// couple of news items without using a database.

$f->add_item(
'EXMP Shares Reach Record High',
'http://example.com/news/2007/share-price',
'News of the new chairman reached Wall Street and EXMP shares...',
'en',
array('article_date'=>strtotime('Today'))
);
$f->add_item(
'New Chairman of ExampleCorp Elected',
'http://example.com/news/2007/chairman',
'Joe Bloggs has been elected president of ExampleCorp...',
'en',
array('article_date'=>strtotime('Yesterday'))
);

// Now we just need to output the feed.

header("Content-Type: application/rss+xml");
print $f->output();

?>

The library also allows you to produce Atom, iCalendar, RDF and various
other feed formats for very little extra effort.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: news | last post by:
We're being asked to get Quickbooks Enterprise edition for our business. We use a completely hand-made online store (PHP and mySQL) and used to simply create CSV sheets that were imported as...
1
by: chuck | last post by:
Hi, I would first like to apologize as i am new to xml and am sure i don't fully understand the concepts/language. I am creating a web site to sell items i make. I want to dynamically create the...
12
by: Woodster | last post by:
I currently have some code for an application that is running on Win32. I have tried to keep anything not directly gui related as separate as possible for portability reasons, including file...
1
by: Andy | last post by:
Hi all, I have a few custom Dlls that I am building here and an automated build / deploy. Ideally, I'd like to integrate the help generated by NDoc during a build into our Studio...
1
by: Nexus | last post by:
I've heard people saying that it can be done (Integrating Flash actionscript into ASP .Net apps ???) - does anyone have a lead on where I might find a coding sample or additional info
2
by: George Durzi | last post by:
I'd like to get some real world feedback from developers out there who have to work with the "design" folks to integrate look and feel stuff into a vs.net web project. A lot of designers use web...
1
by: LP | last post by:
Hello, I am thinking about developing an application on my own free time (web or maybe even windows client) that watches eBay listings, places last seconds winning bids, etc. I am sure someone has...
0
by: johndparker | last post by:
Hi, I have a ASP.NET web application I distribute precompiled (without source code) to clients. This can be run as a standalone web app but I would also like the option of the client integrating...
1
by: shotokan99 | last post by:
hi guys, i want to have rss on my site and the page is written in php (mypage.php). what are the things i need? how to start to with it? pls help.. tnx
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.