I have a WordPress website, and I need a script(does NOT have to be a wordpress plugin) that will create a special XML file of every single post with the following XML tags. . .
__________________
XML VERSION
<Products>
<Product Id=”YOUR_ID_HERE”>
<ProductName></ProductName>
<SetName></SetName>
<Rarity></Rarity>
</Product>
</Products>
__________________
The Product ID will be ‘MagicKards’ for every single post.
The Product Name will be the name of the wordpress post.
The Set Name will be the category that the post is in.
Both of these variables(product name and set name) are included in the URL of the post.
An Example of a URL for my website is. . .
http://www.magickards.com/timeshifted/akroma-angel-of-wrath/
the word ‘timeshifted’ is the set name’ and ‘akroma angel of wrath’ is the product name.
Cards will have these dashes( – ) in place of spaces(in the url) that will need to be removed in the XML file and replaced with spaces.
I need this script to be ran when I go to it in a browser, and I need the script to delete the previous version of the XML file(if there is one there already) when I run the script.