| | #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
|
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..... |
| |
| | #3 |
| HyperActive Warrior War Room Member Join Date: 2010 Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
|
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." | |
| |
| | #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
|
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? |
| |
| | #5 |
| HyperActive Warrior War Room Member Join Date: 2010 Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
|
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." | |
| |
| | #6 | |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
|
First, an RSS file is already an XML file.
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. | |
| |
| | #7 |
| Senior Warrior Member Join Date: 2010
Posts: 1,141
Thanks: 12
Thanked 71 Times in 69 Posts
|
RSS is XML. XML is simply extensible markup language. RSS is a defined set of tags in XML format.
|
| | |
| |
| | #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
|
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)??? |
| |
| | #9 | |
| Active Warrior Join Date: 2011 Location: Atlanta, GA
Posts: 96
Thanks: 0
Thanked 15 Times in 15 Posts
|
Code: <?php
$contents = file_get_contents("http://www.your_feed_url_goes_here.com/");
echo "<textarea rows="50" cols="100">".$contents."</textarea>";
?> 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. | ||
| |
| The Following User Says Thank You to PeachCoding For This Useful Post: |
| | #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
|
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. |
| |
|
| Bookmarks |
| Tags |
| file, rss, xml |
| |