<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webmaster Chronic Blog &#187; CSS to RSS</title>
	<atom:link href="http://www.webmasterchronic.com/tags/css-to-rss/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmasterchronic.com</link>
	<description>Giving You the Good Stuff Since 2k9</description>
	<lastBuildDate>Fri, 03 Sep 2010 12:02:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quick and Dirty CSV to RSS/XML for WordPress Import&#8230;</title>
		<link>http://www.webmasterchronic.com/code/snippets/quick-and-dirty-csv-to-rssxml-for-wordpress-import/</link>
		<comments>http://www.webmasterchronic.com/code/snippets/quick-and-dirty-csv-to-rssxml-for-wordpress-import/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 10:21:14 +0000</pubDate>
		<dc:creator>kpaul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[CSS to RSS]]></category>
		<category><![CDATA[CSV to RSS]]></category>
		<category><![CDATA[CSV to WP]]></category>
		<category><![CDATA[CSV2RSS]]></category>
		<category><![CDATA[CSV2WP]]></category>
		<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[PHP snippets]]></category>
		<category><![CDATA[WordPress Import]]></category>

		<guid isPermaLink="false">http://www.webmasterchronic.com/?p=331</guid>
		<description><![CDATA[After running, you can view the source and save the output to an XML file that you can import into WP. Nothing fancy, but thought it might help one or two ppl&#8230; It is set-up to date the posts every 12 hours, although this is easily changed&#8230; &#60;?php function get_csv($filename, $delim=',') { $row = 0; [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>After running, you can view the source and save the output to an XML file that you can import into WP. Nothing fancy, but thought it might help one or two ppl&#8230; It is set-up to date the posts every 12 hours, although this is easily changed&#8230;</p>
<p><span id="more-331"></span></p>
<pre>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 500px; height: 400px; text-align: left;" dir="ltr">&lt;?php
function get_csv($filename, $delim=',')
{
   $row = 0;
   $dump = array();

   $f = fopen ($filename,"r");
   $size = filesize($filename)+1;
   while ($data = fgetcsv($f, $size, $delim)) {
       $dump[$row] = $data;
       $row++;
   }
   fclose ($f);

   return $dump;
}

$myfile = "123.csv";
$xxx=0;
$mywritefile = "";

$test = get_csv($myfile);

foreach ($test as $mthis) {
$xxx++;
$hourcount = ($xxx * 12);
$mincount = (12 * $xxx);
$futuredate = mktime(date("h")+$hourcount,date("i")+$mincount,date("s")+$mincount,date("m"),date("d"),date("Y"));

$mypubdate = date("D, d M Y h:i:s A",$futuredate);

$mywritefile .= "&lt;item&gt;\n";
$mywritefile .= "&lt;title&gt;".$mthis[0]."&lt;/title&gt;\n";
$mywritefile .= "&lt;category&gt;Your Category Tag&lt;/category&gt;\n";
$mywritefile .= "&lt;content:encoded&gt;".$mthis[1]."&lt;br /&gt;".$mthis[2]."&lt;br /&gt;".$mthis[3]."&lt;br /&gt;".$mthis[4]."&lt;/content:encoded&gt;\n";
$mywritefile .= "&lt;pubDate&gt;".$mypubdate."&lt;/pubDate&gt;\n";
$mywritefile .= "&lt;/item&gt;\n\n\n";

}

echo $mywritefile;

?&gt;</pre>
</pre>
<div id="attachment_347" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-347" title="stockxpertcom_id427371_jpg_52b9c0eb0a111428fa0f9a645ff264e4" src="http://www.webmasterchronic.com/wp-content/uploads/2009/12/stockxpertcom_id427371_jpg_52b9c0eb0a111428fa0f9a645ff264e4-300x200.jpg" alt="My Kind of Woman" width="300" height="200" /><p class="wp-caption-text">My Kind of Woman</p></div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.webmasterchronic.com%2Fcode%2Fsnippets%2Fquick-and-dirty-csv-to-rssxml-for-wordpress-import%2F&amp;linkname=Quick%20and%20Dirty%20CSV%20to%20RSS%2FXML%20for%20WordPress%20Import%26%238230%3B"><img src="http://www.webmasterchronic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.webmasterchronic.com/code/snippets/quick-and-dirty-csv-to-rssxml-for-wordpress-import/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
