HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
How to create rss.php file
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
satimis



Joined: 05 Mar 2008
Posts: 13

PostPosted: Wed Mar 12, 2008 6:03 pm     How to create rss.php file Reply with quote

Hi folks,


If I found an interesting news site but can't find *.rss.php how can I create it?

e.g.
http://www.ft.com/world/us

How to search the news sites with *rss.php file available? TIA


B.R.
satimis
kanenas



Joined: 14 Dec 2004
Posts: 191

PostPosted: Sun Mar 16, 2008 12:46 am     Re: How to create rss.php file Reply with quote

satimis wrote:
Hi folks,


If I found an interesting news site but can't find *.rss.php how can I create it?


Short answer: you don't, the site developer/s does/do.

To create an RSS feed, you need a list of site updates. As you are just a user of the site, you don't have such a list.

If you really wanted to, you could write a program which would periodically (once per hour or day) fetch the page, parse it, find the section which lists articles and extract that fragment, check for new articles, add those to your stored list of articles. Yecch. Alternatively, contact whoever is in charge of the site and request they add an RSS feed.

Of course, before you try any of that make sure the site doesn't already have a feed; there aren't many that don't. For example, the site you gave has many feeds, though they weren't readily found.

Quote:

e.g.
http://www.ft.com/world/us

How to search the news sites with *rss.php file available?

I don't understand this question. Could you rephrase or elaborate?
satimis



Joined: 05 Mar 2008
Posts: 13

PostPosted: Sun Mar 16, 2008 7:02 am     Re: How to create rss.php file Reply with quote

kanenas wrote:
satimis wrote:
Hi folks,


If I found an interesting news site but can't find *.rss.php how can I create it?


Short answer: you don't, the site developer/s does/do.

To create an RSS feed, you need a list of site updates. As you are just a user of the site, you don't have such a list.

If you really wanted to, you could write a program which would periodically (once per hour or day) fetch the page, parse it, find the section which lists articles and extract that fragment, check for new articles, add those to your stored list of articles. Yecch. Alternatively, contact whoever is in charge of the site and request they add an RSS feed.

Of course, before you try any of that make sure the site doesn't already have a feed; there aren't many that don't. For example, the site you gave has many feeds, though they weren't readily found.

Quote:

e.g.
http://www.ft.com/world/us

How to search the news sites with *rss.php file available?

I don't understand this question. Could you rephrase or elaborate?

Thanks for your advice.


I have php parser running on my website which is hoisted on my own server. Visitors browsing my site can read online rews. My website is for test only NOT for production.


What I'm searching for is the RSS feed URL such as;
Code:

http://www.rte.ie/rss/gaa.xml
http://www.independent.ie/sport/hurling/rss
etc.



e.g.
Code:
http://www.ft.com/rss/world

is the URL which I'm looking for. I need it to integrate to the PHP parser. After its adding, visitors browsing my site can now read online news on "FT.com - World".


On some websites on Internet I can't find the RSS. How can I find it?


If there is no RSS on those sites of my interest whether I can create it myself?


TIA


Furthermore I suppose not necessary to subscribe to their site to update the news because the news on my website are feed by them. If they update their news my website will also be updated simultaneously. If I'm wrong please correct me. Thanks.


B.R.
satimis
kanenas



Joined: 14 Dec 2004
Posts: 191

PostPosted: Sun Mar 16, 2008 9:56 am     Re: How to create rss.php file Reply with quote

satimis wrote:

[...]

On some websites on Internet I can't find the RSS. How can I find it?


You find an RSS feed the way you find anything on the web: site search, web search, check the site map. The last is how I found the feeds for ft.com.


satimis wrote:

If there is no RSS on those sites of my interest whether I can create it myself?

Not easily. As mentioned before, you need to generate a list of site updates by periodically parsing the target website and looking for changes. If you can't find an RSS feed, I recommend contacting the site and requesting one over generating one yourself. If they have one you just couldn't find, they'll want to know they should make their feed easier to find.

Does that answer your questions?
satimis



Joined: 05 Mar 2008
Posts: 13

PostPosted: Sun Mar 16, 2008 4:50 pm     Re: How to create rss.php file Reply with quote

kanenas wrote:

Not easily. As mentioned before, you need to generate a list of site updates by periodically parsing the target website and looking for changes.

Anyway to start. Pointer would be appreciated. This field is completely new to me disregarding having prolonged experience on building Linux and Unix server/my own Linux OS and security. I only have one week experience on this field. But there is no connection with my then experience.


Do you have experience on;

SimplePie
http://simplepie.org/

ListGarden
http://www.softwaregarden.com/products/listgarden/

???


The former looks like PHP parser on server similar to;

lastRSS
http://lastrss.oslab.net/


The later looks like RSS reader on workstation.


Are you aware parser written on javascript? TIA


B.R.
satimis
kanenas



Joined: 14 Dec 2004
Posts: 191

PostPosted: Wed Mar 19, 2008 12:36 pm     Re: How to create rss.php file Reply with quote

I need a clarification. Do you want to use RSS feeds to generate content for your website? Do you want your own RSS feed that gets its content from other RSS feeds?

satimis wrote:
Anyway to start. Pointer would be appreciated. This field is completely new to me disregarding having prolonged experience on building Linux and Unix server/my own Linux OS and security. I only have one week experience on this field. But there is no connection with my then experience.


In cases where a site has no RSS feed, you need to start with the page to generate a feed from, e.g. http://www.ft.com/world/us; it should include headlines or a list of articles or abstracts or somesuch. You'll write a program (outline given below) to parse information on the page and store it in a database, probably the same one your RSS publisher uses. In the outline, links are given to Perl and PHP modules which could help you, but you are free to use any language you want (it can be different than the implementation language of your RSS publisher).

  1. Fetch the page. Under Perl, this'd probably be LWP. Under PHP you can skip this step.
  2. Parse the page; you'll want the result to support the DOM for the next step. Under Perl, check out XML::DOM and XML::DOM::Lite. PHP5 has builtin support for XML and HTML via its DOM, though you may find the Simple HTML DOM Parser easier to use. The PHP functions/methods can take URL whenever a pathname is specified (this is why step 1 above is unnecessary under PHP).
  3. Find the chunk of the parsed document which contains the article abstracts. This may be tricky and will vary wildly from page to page. DOM support will make this not as hard. Take ft.com/world/us for example. All the articles abstracts are children of a node with class 'index-detail'. If the API you're using supports getting elements by class, you can easily grab the 'index-detail' node (note that getting elements by class may return nodes you aren't interested in). Of course, the API may not support getting elementsy by class, in which case you can roll your own. The ft.com example provides an alternative: the 'index-detail' node is a child of a DIV with id='content'. Use getElementByID, then iterate over the children until you find the 'index-detail' node.
  4. For each article node:
    1. extract the title or description
    2. extract a link to the article
    3. look for the article in the database by title/description, link and the page URI. If not found, add the article and the current time.

Voila. You now have the information you need to generate RSS feeds. Again, the easier way is to ask the site admins to create their own feed (it's their job, not yours).

satimis wrote:
Do you have experience on;

SimplePie
http://simplepie.org/
ListGarden
http://www.softwaregarden.com/products/listgarden/

No experience, but you're correct that SimplePie looks to be an RSS parser (useful for an RSS client), whereas ListGarden is an RSS publisher (useful server side). SimplePie could help you mix multiple RSS feeds into one, or generate site content (e.g. a 'news' section), or perhaps dump them into an RSS publisher.

satimis wrote:
Are you aware parser written on javascript? TIA

HTML or RSS parser? Are you using javascript server side, or hoping to create a client-side RSS aggregator? Client side, you won't need a parser, as the browser should handle that. I don't know about server side. Note that if you hope to create an RSS feed for someone else's website, you'll need to do it server side.

In your first post:
satimis wrote:
Furthermore I suppose not necessary to subscribe to their site to update the news because the news on my website are feed by them. If they update their news my website will also be updated simultaneously. If I'm wrong please correct me. Thanks.

Not necessary for who to subscribe? Your site will be subscribed to the other RSS feeds, but the users of your site won't need to subscribe to the other RSS feeds. Your site won't be updated simultaneously. RSS feeds aren't (yet) a push technology, so there will be a delay depending on the polling frequency.
satimis



Joined: 05 Mar 2008
Posts: 13

PostPosted: Wed Mar 19, 2008 6:16 pm     Re: How to create rss.php file Reply with quote

Hi kanenas,


Thanks for your detail advice.


After googling around couple days now I'm clear what I need on this posting is RSS writer/burner. I found many of them on Internet for download/online use generating RSS feed. They are free to download and free to use for unlimited time. However I expect learning to write the RSS feed rather than clicking around on screen with mouse pointer. I don't expect repeating the same mistake which I did 10 year ago while working on Windows, learning nothing finally.


I found good examples on wikipedia;
http://en.wikipedia.org/wiki/RSS#Examples


Quote:

I need a clarification. Do you want to use RSS feeds to generate content for your website? Do you want your own RSS feed that gets its content from other RSS feeds?

Actually I need a script to generate RSS feed on those sites if I can't find it.


With the same script after minor modification I suppose I can generate RSS feed of my site.


A side question;
How to find the sitemap of a website in an easy way? Running "sitemap site:site_url" on Google search box is NOT always work.


Quote:

[list=1]
[*]Fetch the page. Under Perl, this'd probably be LWP. Under PHP you can skip this step.
[*]Parse the page; you'll want the result to support the DOM for the next step. Under Perl, ........
.......

I'll follow your instruction learning to build RSS feed. In case of difficulty I'll come back to the forum. Thanks again.


One question, the language suggested is CPAN. I played around CPAN many years ago I almost forgot it. In my recollection there are many modules on CPAN. Is there a module suitable for this job?


Quote:

Voila. You now have the information you need to generate RSS feeds. Again, the easier way is to ask the site admins to create their own feed (it's their job, not yours).

Yes, you're right. My target is to learn writing the feed script. Otherwise I won't go the hard way.


Quote:

satimis wrote:
Are you aware parser written on javascript? TIA

HTML or RSS parser? Are you using javascript server side, or hoping to create a client-side RSS aggregator? Client side, you won't need a parser, as the browser should handle that. I don't know about server side. Note that if you hope to create an RSS feed for someone else's website, you'll need to do it server side.

On the server side.

Sorry I'm NOT quite clear of your question "HTML or RSS parser". Some sites provide RSS feed and another XML feed. The parser must work on both. Googling found many PHP parsers written on PHP. I wonder whether it can be written on javascript.


Quote:

In your first post:
satimis wrote:
Furthermore I suppose not necessary to subscribe to their site to update the news because the news on my website are feed by them. If they update their news my website will also be updated simultaneously. If I'm wrong please correct me. Thanks.

Not necessary for who to subscribe? Your site will be subscribed to the other RSS feeds, but the users of your site won't need to subscribe to the other RSS feeds. Your site won't be updated simultaneously. RSS feeds aren't (yet) a push technology, so there will be a delay depending on the polling frequency.

On the RSS feed page there is a notice "subscribe .... the news will be updated automatically..." something like that. I'm running the parser on server. I wonder whether I need to subscribe? OR only the client, i.e. the parser running on workstation, needs to subscribe. I think the parser on the server side will update the news automatically. Visitors browsing on my website can read the updated news in time. If I'm wrong please correct me.


Others noted with thanks.


B.R.
satimis
Dyami



Joined: 20 Jul 2008
Posts: 30

PostPosted: Wed Jul 30, 2008 11:39 pm     Reply with quote

By creating website using Joomla. no need to create rss file ourself. It will create rss file automtically.

______________________________
web design company
free templates
satimis



Joined: 05 Mar 2008
Posts: 13

PostPosted: Thu Jul 31, 2008 12:08 am     Reply with quote

Dyami wrote:
By creating website using Joomla. no need to create rss file ourself. It will create rss file automtically.

______________________________
web design company
free templates

Noted with thanks


satimis
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial