Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 30th May 2011, 09:25 AM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2007
Location: Australia, S'pore, M'sia .
Posts: 157
Thanks: 14
Thanked 15 Times in 14 Posts
Default
RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

I need to create a XML file, using the RSS feed.

Trouble is, is that I have NO idea where to even start.

Anyone comfortable with this please PM me to find out more.....
astaga is offline  
Unread 30th May 2011, 06:22 PM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2005
Location: , , USA.
Posts: 410
Thanks: 0
Thanked 101 Times in 54 Posts
Blog Entries: 5
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

Google simple xml - you'll find some examples and it's available by default with php 5+
stma is offline  
Unread 30th May 2011, 07:17 PM   #3
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

You'll need to give more info. Its unclear whether you want to do this for _your_ RSS feed from your server and so have direct access to the data coming from the database or whether it is someone elses RSS feed that you want to transform into XML structure to do something with it.

If its the second, what is the form of the incoming RSS feed and what does the structure of the XML need to look like.

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 30th May 2011, 08:02 PM   #4
HyperActive Warrior
War Room Member
 
Join Date: 2007
Location: Australia, S'pore, M'sia .
Posts: 157
Thanks: 14
Thanked 15 Times in 14 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

The RSS is external, from Amazon, eg. Amazon's Bestsellers. The need is to make an XML file with the data fields re-ordered to a format containing following lines:
<?xml version="1.0" encoding="utf-8"?>
<list>
<list image="item1 image URL" action="URL of item on Amazon site" rel="nofollow" target="_new"
title="item title" desc="item description (limit 200 characters"/>
<list image="item2 image URL" action="URL of item on Amazon site" rel="nofollow" target="_new"
title="item title" desc="item description (limit 200 characters"/>
.etc...... repeated 20 times

</list>


How does one know what is coming down the feed on any RSS, if these are external feeds?
astaga is offline  
Unread 30th May 2011, 08:29 PM   #5
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

If it was me, I would look at the structure it came down in for any structural formats that I could use, then write a script in php to re-format those structures into the format I wanted.

Look for things like <div class="the_image"><img.........></div> then use a regular expression to match that and get the contents to output to XML.

Someone else might have a trick to it that already has been built since it a big one like an amazon feed though.

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 31st May 2011, 05:35 AM   #6
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

First, an RSS file is already an XML file.
Originally Posted by astaga View Post

How does one know what is coming down the feed on any RSS, if these are external feeds?
You'll need to look at it.
There are a limited number of RSS formats and they are all well defined, but not every field will be used. RSS at Wikipedia

How to convert it?
Figure out the RSS files format.
Parse it.
Write it out in the new format.
KirkMcD is offline  
Unread 31st May 2011, 06:10 AM   #7
Senior Warrior Member
 
Join Date: 2010
Posts: 1,141
Thanks: 12
Thanked 71 Times in 69 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

RSS is XML. XML is simply extensible markup language. RSS is a defined set of tags in XML format.

HorseStall is offline  
Unread 31st May 2011, 10:12 AM   #8
HyperActive Warrior
War Room Member
 
Join Date: 2007
Location: Australia, S'pore, M'sia .
Posts: 157
Thanks: 14
Thanked 15 Times in 14 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

OK, for the "looking part", are there any "tools" that will allow me to look at the raw feed so I know what is in the stream, and know what kind of data (fields???) exists ?

Like some sort of "peeper" (for want of a better word)???
astaga is offline  
Unread 31st May 2011, 10:35 AM   #9
Active Warrior
 
PeachCoding's Avatar
 
Join Date: 2011
Location: Atlanta, GA
Posts: 96
Thanks: 0
Thanked 15 Times in 15 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

Originally Posted by astaga View Post

OK, for the "looking part", are there any "tools" that will allow me to look at the raw feed so I know what is in the stream, and know what kind of data (fields???) exists ?

Like some sort of "peeper" (for want of a better word)???
To get a copy of the XML file an RSS feed will return to your PHP file just create a new php file with the following code on it:

Code:
<?php
$contents = file_get_contents("http://www.your_feed_url_goes_here.com/");
echo "<textarea rows="50" cols="100">".$contents."</textarea>";
?>
When you load the new php page on a browser you will get a textbox with the RSS code inside of it.

Hope that helps.

Services offered: PSD to Wordpress, Joomla, Drupal Templates or Full Site, Custom PHP or C# Programming, Fix problems on any software, and more.

You will get 25% OFF all services by mentioning the Warrior Forum. PM me here or email me to ivanphp404@gmail.com if interested and/or if you have questions.
PeachCoding is offline  
The Following User Says Thank You to PeachCoding For This Useful Post:
Unread 5th Jun 2011, 05:43 AM   #10
HyperActive Warrior
War Room Member
 
Join Date: 2007
Location: Australia, S'pore, M'sia .
Posts: 157
Thanks: 14
Thanked 15 Times in 14 Posts
Default
Re: RSS to XML file? How?
Share on: 
fb share twitter share gplus share more share

Thanks Peachcoding for that advice.

OK, now I got something on screen using your help and I can see the various fields via a View Source. Looking at this source and laying it side by side to the XML file layout I need, it's simple to say in a humanly language what it needs to be converted to in needed XML file, but the computer doesn't understand my human language, and I don't quite know computer-speak !

A beer to anyone who care to help, please PM me.
astaga is offline  
Closed Thread


Bookmarks

Tags
file, rss, xml


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 05:00 AM.