<?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>MichaelMaguire.Info</title>
	<atom:link href="http://michaelmaguire.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelmaguire.info</link>
	<description>All about me...</description>
	<lastBuildDate>Sat, 15 Jan 2011 21:49:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Who is the sexiest man in Ohio?</title>
		<link>http://michaelmaguire.info/2011/01/who-is-the-sexiest-man-in-ohio/</link>
		<comments>http://michaelmaguire.info/2011/01/who-is-the-sexiest-man-in-ohio/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 21:49:33 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[free time]]></category>
		<category><![CDATA[fun stuff]]></category>
		<category><![CDATA[ohio]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[sexiest man]]></category>

		<guid isPermaLink="false">http://michaelmaguire.info/?p=76</guid>
		<description><![CDATA[There are not many result when you look for sexy men in Ohio on any search engine. I tend to make the most of the friends that I have and keep them close. Since these friends carry some pretty powerful titles on the internet; John Ward &#8211; Sexiest man in WV, Tony Schiffbauer &#8211; Sexiest [...]]]></description>
			<content:encoded><![CDATA[<p>There are not many result when you look for sexy men in Ohio on any search engine.  I tend to make the most of the friends that I have and keep them close. Since these friends carry some pretty powerful titles on the internet; <a href="http://johnathanward.com/life/who-is-the-sexiest-man-in-west-virginia">John Ward &#8211; Sexiest man in WV</a>, <a href="http://www.tonyrocks.com/index.php/viral-marketing/tony-schiffbauer-the-sexiest-man-in-pittsburgh/">Tony Schiffbauer &#8211; Sexiest Man in Pittsburgh</a>, and <a href="http://www.tonyrocks.com/index.php/entertainment/santosh-perla-the-sexiest-man-in-india/">Santosh Perla</a> it isn&#8217;t hard to assume that I must inherently get the title of sexiest man in Ohio. </p>
]]></content:encoded>
			<wfw:commentRss>http://michaelmaguire.info/2011/01/who-is-the-sexiest-man-in-ohio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse XML &amp; CSV Files into a Data Table</title>
		<link>http://michaelmaguire.info/2010/05/parse-xml-csv-files-into-a-data-table/</link>
		<comments>http://michaelmaguire.info/2010/05/parse-xml-csv-files-into-a-data-table/#comments</comments>
		<pubDate>Wed, 19 May 2010 03:11:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://michaelmaguire.info/?p=66</guid>
		<description><![CDATA[As I have mentioned in the past, I am a fan of anything that can help automate a task and will do anything outside the box to get a process automated and use all the resources at my disposal. One of out latest projects that we are working on is a coupon site that will automatically grab coupons from all of our affiliates and post them automatically. We also wanted to have the ability to updated existing coupons if a better deal is found. Enter a .NET service]]></description>
			<content:encoded><![CDATA[<p>As I have mentioned in the past, I am a fan of anything that can help automate a task and will do anything outside the box to get a process automated and use all the resources at my disposal. One of out latest projects that we are working on is a coupon site that will automatically grab coupons from all of our affiliates and post them automatically. We also wanted to have the ability to updated existing coupons if a better deal is found. Enter a .NET service.</p>
<p>The major thing I wonted to cover in this post was how to get the separate files we would be receiving from our affiliates into data tables. The types of files we will received for this project are both CSV (Comma Separated Values) as well as XML (Extensible Markup Language). I wanted the end result to be the same type of object so that the same class could handle the processing algorithms without having to use overloaded methods or any type of polymorphism. Getting them to data tables seemed like a fairly viable solution because then I would only need to know which columns to grab based off which affiliate we were currently processing; information which is stored in the database with all of the affiliate information. </p>
<p>Getting these files to a data table actually ended up being a fairly easy task once I sat down and thought about it as well as look through some online articles about common ways of handling this type of information. Having worked with XML a lot in the past, I was confident this should not be hard. Let&#8217;s start taking a look at how it works. Lets start with the CSV file.</p>
<pre class="brush: csharp; title: ;">
public DataTable ParseCSV(string path)
{
    if (!File.Exists(path))
        return null;
    string full = Path.GetFullPath(path);
    string file = Path.GetFileName(full);
    string dir = Path.GetDirectoryName(full);
    string connString = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot;
    + &quot;Data Source=\&quot;&quot; + dir + &quot;\\\&quot;;&quot;
    + &quot;Extended Properties=\&quot;text;HDR=No;FMT=Delimited\&quot;&quot;;
    string query = &quot;SELECT * FROM &quot; + file;
    DataTable dTable = new DataTable();
    OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);
    try
    {
        dAdapter.Fill(dTable);
    }
    catch (Exception ex)
    {
        WriteError(ex);
    }
    dAdapter.Dispose();
    return dTable;
}
</pre>
<p>As you can see, not a whole lot to it. It simply gets passed a file location on the hard drive, gets the file information, and builds a OLEDB request setting the data source as the directory. Then we select * from the file which we can throw the results into a data table. Then we just run it through the rest of the class for it to process each row to see if the store exists, the coupon exists, and that the coupon is active and create database record where necessary. </p>
<pre class="brush: csharp; title: ;">
StringReader XMLReader= new StringReader(filePath);
DataSet XMLTables= new DataSet();
theDataSet.ReadXml(XMLReader.ReadToEnd());
DataTable dtValues = XMLTables.Tables[Convert.ToInt32(intTableDepth)];
return dtValues;
</pre>
<p>This was the one I didn&#8217;t realize would be as easy as it was. When the file is passed through the ReadToEnd it parses the information into a data set, each child set having it&#8217;s own table. All that is needed to parse the XML properly is to know how deep the data is housed within the XML (the child nodes that house each item). In this case, I have a function that figures it out and passes it to this function when it&#8217;s called.</p>
<p>Now, all that needs done is to pass the data table to the functions that iterate through the information and collect what is needed. That pretty much sums up that part of this project. Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelmaguire.info/2010/05/parse-xml-csv-files-into-a-data-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse XML into Treeview</title>
		<link>http://michaelmaguire.info/2010/05/parse-xml-into-treeview/</link>
		<comments>http://michaelmaguire.info/2010/05/parse-xml-into-treeview/#comments</comments>
		<pubDate>Sat, 01 May 2010 22:02:39 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://michaelmaguire.info/?p=51</guid>
		<description><![CDATA[Where I currently work, there are a lot of *nix based systems that write logs to a log file on the hard drive and they are recorded in XML format. When looking for your problem or issue based off certain information and are trying to troubleshoot, it can be very hard to look through all those lines through a terminal screen. I made a tool that will allow you to copy several lines of the log into a text box and it will create a tab with a tree-view control on each tab and automatically parse each line from the log into it's own tree-view.]]></description>
			<content:encoded><![CDATA[<p>Where I currently work, there are a lot of *nix based systems that write logs to a log file on the hard drive and they are recorded in XML format. When looking for your problem or issue based off certain information and are trying to troubleshoot, it can be very hard to look through all those lines through a terminal screen. I made a tool that will allow you to copy several lines of the log into a text box and it will create a tab with a tree-view control on each tab and automatically parse each line from the log into it&#8217;s own tree-view. This has made supporting these things a little easier and it wasn&#8217;t that hard to achieve. Let&#8217;s take a look at the bulk of the program. On the form, there is a text box, a button, and a tab view. </p>
<pre class="brush: csharp; title: ;">
        private void cmdParse_Click(object sender, EventArgs e)
        {
            if (txtInput.Text != String.Empty)
            {
                tvXMLView.ResetText();
                FillTree(tvXMLView);
            }
        }
</pre>
<p>This is just called when the user clicks a button and makes sure the text box is not empty. We are going to omit the code about adding the tab and tree view to the form, so the next step is to run the FillTree function.</p>
<pre class="brush: csharp; title: ;">
        private void FillTree(TreeView currenttree)
        {
            try
            {
                XmlDocument dom = new XmlDocument();
                dom.LoadXml(txtInput.Text);
                currenttree.Nodes.Clear();
                currenttree.Nodes.Add(new TreeNode(dom.DocumentElement.Name));
                TreeNode tNode = new TreeNode();
                tNode = currenttree.Nodes[0];
                AddNode(dom.DocumentElement, tNode);
            }
            catch (XmlException xmlex)
            {
                MessageBox.Show(&quot;XML Malformed. Reason for Error: - &quot; + xmlex.Message, &quot;Error&quot;);
            }
            catch (Exception ex)
            {
                MessageBox.Show(&quot;Non XML Error Occured: &quot; + ex.Message, &quot;Error&quot;);
            }
        }
 </pre>
<p>First we create an XmlDocument that we can use to read through the XML in the text box. Next we ensure the tree view is empty and we are not going to append more data to an already parsed tree view. Then we begin to iterate through the values and processing them through the AddNode function.</p>
<pre class="brush: csharp; title: ;">
        private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
        {
            string strCheck;
            XmlNode xNode;
            TreeNode tNode;
            XmlNodeList nodeList;
            int intLength;
            int intStart;
            int intEnd;
            int i = 0;
            if (inXmlNode.HasChildNodes)
            {
                nodeList = inXmlNode.ChildNodes;
                for (i = 0; i &lt;= nodeList.Count - 1; i++)
                {
                    xNode = inXmlNode.ChildNodes[i];
                    inTreeNode.Nodes.Add(new TreeNode(xNode.Name));
                    tNode = inTreeNode.Nodes[(int)i];
                    AddNode(xNode, tNode);
                }
            }
            else
            {
                if ((inXmlNode.OuterXml).Trim().Contains(&quot;&gt;&lt;/&quot;))
                {
                    strCheck = (inXmlNode.OuterXml).Trim();
                    intStart = 1;
                    intEnd = strCheck.IndexOf(&quot;&gt;&lt;/&quot;) + 3;
                    intLength = strCheck.Length - intEnd;
                    strCheck = strCheck.Substring(intStart, intLength - 1);
                    inTreeNode.Text = strCheck;
                }
                else
                {
                    strCheck = inXmlNode.OuterXml.Trim();
                    inTreeNode.Text = strCheck;
                }
            }
            tvXMLView.ExpandAll();
        }
</pre>
<p>As you can see, we are passing the node we are currently running and the tree view we are currently using. We check for it to contain children (indicating a parent node) and if it does, we create that node and then call the same function to go down through until we reach the child. Once the child is reached, we post the value of the child to the bottom node and then work back through. I also added a little bit of code to parse out the open and close brackets for the items in the event there is no value for that node. That about does it. That is all it takes. It can take this XML (found on Microsoft&#8217;s website as an XML sample) and parse it into a tree view.</p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;catalog&gt;
   &lt;book id=&quot;bk101&quot;&gt;
      &lt;author&gt;Gambardella, Matthew&lt;/author&gt;
      &lt;title&gt;XML Developer's Guide&lt;/title&gt;
      &lt;genre&gt;Computer&lt;/genre&gt;
      &lt;price&gt;44.95&lt;/price&gt;
      &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;
      &lt;description&gt;An in-depth look at creating applications
      with XML.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk102&quot;&gt;
      &lt;author&gt;Ralls, Kim&lt;/author&gt;
      &lt;title&gt;Midnight Rain&lt;/title&gt;
      &lt;genre&gt;Fantasy&lt;/genre&gt;
      &lt;price&gt;5.95&lt;/price&gt;
      &lt;publish_date&gt;2000-12-16&lt;/publish_date&gt;
      &lt;description&gt;A former architect battles corporate zombies,
      an evil sorceress, and her own childhood to become queen
      of the world.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk103&quot;&gt;
      &lt;author&gt;Corets, Eva&lt;/author&gt;
      &lt;title&gt;Maeve Ascendant&lt;/title&gt;
      &lt;genre&gt;Fantasy&lt;/genre&gt;
      &lt;price&gt;5.95&lt;/price&gt;
      &lt;publish_date&gt;2000-11-17&lt;/publish_date&gt;
      &lt;description&gt;After the collapse of a nanotechnology
      society in England, the young survivors lay the
      foundation for a new society.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk104&quot;&gt;
      &lt;author&gt;Corets, Eva&lt;/author&gt;
      &lt;title&gt;Oberon's Legacy&lt;/title&gt;
      &lt;genre&gt;Fantasy&lt;/genre&gt;
      &lt;price&gt;5.95&lt;/price&gt;
      &lt;publish_date&gt;2001-03-10&lt;/publish_date&gt;
      &lt;description&gt;In post-apocalypse England, the mysterious
      agent known only as Oberon helps to create a new life
      for the inhabitants of London. Sequel to Maeve
      Ascendant.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk105&quot;&gt;
      &lt;author&gt;Corets, Eva&lt;/author&gt;
      &lt;title&gt;The Sundered Grail&lt;/title&gt;
      &lt;genre&gt;Fantasy&lt;/genre&gt;
      &lt;price&gt;5.95&lt;/price&gt;
      &lt;publish_date&gt;2001-09-10&lt;/publish_date&gt;
      &lt;description&gt;The two daughters of Maeve, half-sisters,
      battle one another for control of England. Sequel to
      Oberon's Legacy.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk106&quot;&gt;
      &lt;author&gt;Randall, Cynthia&lt;/author&gt;
      &lt;title&gt;Lover Birds&lt;/title&gt;
      &lt;genre&gt;Romance&lt;/genre&gt;
      &lt;price&gt;4.95&lt;/price&gt;
      &lt;publish_date&gt;2000-09-02&lt;/publish_date&gt;
      &lt;description&gt;When Carla meets Paul at an ornithology
      conference, tempers fly as feathers get ruffled.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk107&quot;&gt;
      &lt;author&gt;Thurman, Paula&lt;/author&gt;
      &lt;title&gt;Splish Splash&lt;/title&gt;
      &lt;genre&gt;Romance&lt;/genre&gt;
      &lt;price&gt;4.95&lt;/price&gt;
      &lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;
      &lt;description&gt;A deep sea diver finds true love twenty
      thousand leagues beneath the sea.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk108&quot;&gt;
      &lt;author&gt;Knorr, Stefan&lt;/author&gt;
      &lt;title&gt;Creepy Crawlies&lt;/title&gt;
      &lt;genre&gt;Horror&lt;/genre&gt;
      &lt;price&gt;4.95&lt;/price&gt;
      &lt;publish_date&gt;2000-12-06&lt;/publish_date&gt;
      &lt;description&gt;An anthology of horror stories about roaches,
      centipedes, scorpions  and other insects.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk109&quot;&gt;
      &lt;author&gt;Kress, Peter&lt;/author&gt;
      &lt;title&gt;Paradox Lost&lt;/title&gt;
      &lt;genre&gt;Science Fiction&lt;/genre&gt;
      &lt;price&gt;6.95&lt;/price&gt;
      &lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;
      &lt;description&gt;After an inadvertant trip through a Heisenberg
      Uncertainty Device, James Salway discovers the problems
      of being quantum.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk110&quot;&gt;
      &lt;author&gt;O'Brien, Tim&lt;/author&gt;
      &lt;title&gt;Microsoft .NET: The Programming Bible&lt;/title&gt;
      &lt;genre&gt;Computer&lt;/genre&gt;
      &lt;price&gt;36.95&lt;/price&gt;
      &lt;publish_date&gt;2000-12-09&lt;/publish_date&gt;
      &lt;description&gt;Microsoft's .NET initiative is explored in
      detail in this deep programmer's reference.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk111&quot;&gt;
      &lt;author&gt;O'Brien, Tim&lt;/author&gt;
      &lt;title&gt;MSXML3: A Comprehensive Guide&lt;/title&gt;
      &lt;genre&gt;Computer&lt;/genre&gt;
      &lt;price&gt;36.95&lt;/price&gt;
      &lt;publish_date&gt;2000-12-01&lt;/publish_date&gt;
      &lt;description&gt;The Microsoft MSXML3 parser is covered in
      detail, with attention to XML DOM interfaces, XSLT processing,
      SAX and more.&lt;/description&gt;
   &lt;/book&gt;
   &lt;book id=&quot;bk112&quot;&gt;
      &lt;author&gt;Galos, Mike&lt;/author&gt;
      &lt;title&gt;Visual Studio 7: A Comprehensive Guide&lt;/title&gt;
      &lt;genre&gt;Computer&lt;/genre&gt;
      &lt;price&gt;49.95&lt;/price&gt;
      &lt;publish_date&gt;2001-04-16&lt;/publish_date&gt;
      &lt;description&gt;Microsoft Visual Studio 7 is explored in depth,
      looking at how Visual Basic, Visual C++, C#, and ASP+ are
      integrated into a comprehensive development
      environment.&lt;/description&gt;
   &lt;/book&gt;
&lt;/catalog&gt;
</pre>
<p>Viola!<br />
<div id="attachment_56" class="wp-caption alignnone" style="width: 460px"><a href="http://michaelmaguire.info/wp-content/uploads/2010/05/xml_parser.jpg"><img src="http://michaelmaguire.info/wp-content/uploads/2010/05/xml_parser.jpg" alt="xml_parser" title="xml_parser" width="450" height="398" class="size-full wp-image-56" /></a><p class="wp-caption-text">Note - I made the above form just for the purpose of this post</p></div></p>
<p>This simple tool has made a world of difference at work and everyone that supports the systems now uses it. I also made it so that you can right-click on the value and copy it to your clipboard so that you can have it without typing it as some of the values we are looking for can be long hexadecimal values. Then I added some preferences through a control panel that updates the registry and made this a full-featured tool. That concludes this post. Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelmaguire.info/2010/05/parse-xml-into-treeview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Images for TutorialGrad</title>
		<link>http://michaelmaguire.info/2010/04/image_for_tutorialgrad/</link>
		<comments>http://michaelmaguire.info/2010/04/image_for_tutorialgrad/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 01:43:37 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://michaelmaguire.info/?p=25</guid>
		<description><![CDATA[<p>My partner , <a href="http://johnathanward.com">John Ward</a>, and I have been working on a lot of new projects that we think are great and they are starting to finally come together. In this post I am going to cover some details of what went into making <a href="http://tutorialgrad.com">TutorialGrad</a>; our new tutorial site that monitors, updates, and posts tutorials all on it's own. This site took a while to figure out how to make it work and make it as easy to use by end users as possible.]]></description>
			<content:encoded><![CDATA[<p>My partner , <a href="http://johnathanward.com">John Ward</a>, and I have been working on a lot of new projects that we think are great and they are starting to finally come together. In this post I am going to cover some details of what went into making <a href="http://tutorialgrad.com">TutorialGrad</a>; our new tutorial site that monitors, updates, and posts tutorials all on it&#8217;s own. This site took a while to figure out how to make it work and make it as easy to use by end users as possible. Let&#8217;s begin.</p>
<p>We started this project because of the ridiculous changes that have been made to a once highly respected tutorial site that caused it&#8217;s traffic and overall outlook to become terrible. They have let a lot of people down and there should be sites to counteract what was done. I am talking about <a href="http://tutorialized.com">Tutorialized</a>. More about what they have done and where they went wrong can be read on <a href="http://johnathanward.com/studies/how-to-ruin-a-great-website" target="_blank">John&#8217;s detailed blog post</a>.</p>
<p>To make this site work, several things needed to be done. In this post, we are going to look at something that I wanted to be done automatically that you can pay to have done, but I felt this was something we could achieve for free. The feature I am talking about the ability to take a screenshot of a page and make it the thumbnail of a newly added site automatically with absolutely no intervention from us. On the main page of the site, there is a bar to add a URL of an RSS feed that we will use to scrape the content of your site and post them on our site automatically. Once a URL is entered, a row is put into a job queue table where the image creation begins.</p>
<p>The server this runs on is a command line only install of CentOS and does not have X windows or anything installed to produce graphical output. To achieve the browser view and take a screenshot, I used a virtual display using <a href="http://en.wikipedia.org/wiki/Xvfb">X Windows Virtual Frame Buffer</a> This is a powerful tool that will allow you to create, control, and even view the graphical output via command line. You can use VNC over SSH to have visual remote control to a machine as well. Once this was configured on the server and I installed the necessary modules for firefox and some necessary font files we were ready to roll. I decided to use a cron job that calls the PHP interpreter and runs a PHP file to make like easier. The PHP file is in a secure location not access by the apache processes so it wont be accidentally called for any reason.</p>
<p>Some of the more interesting code in the PHP follows. We grab all the rows that currently need processed form the database and begin processing them. For each row, we run the following code:</p>
<pre class="brush: php; title: ;">
 //get url from database
$url = $row['site_url'];

//Calls the virtual frame buffer and creates a virtual display and tells it what to run
$shellfile .= &quot;DISPLAY=:3 firefox '$url' &amp;\n&quot;;

//give the browser time to load
$shellfile .= &quot;sleep 12\n&quot;;

//capture the screenshot of what is currently being displayed (id passed from database)
$shellfile .= &quot;DISPLAY=:3 import -window root '/home/tutorial/public_html/avatar/$id.jpg'\n&quot;;

//wait for the image to be captured
$shellfile .= &quot;sleep 3\n&quot;;

//kill firefox (don't want hundreds of instances running)
$shellfile .= &quot;pkill firefox\n&quot;;

//wait for firefox to be killed
$shellfile .= &quot;sleep 3\n&quot;;

//add final shell script line to kill the X virtual frame buffer
$shellfile .= &quot;pkill Xvfb\n\n&quot;;

//compile the above strings into an actual file on the hard drive of the server
$shell = &quot;autoimage.sh&quot;;
$fh = fopen($shell, 'w') or die(&quot;can't open file&quot;);
fwrite($fh, $shellfile);
fclose($fh);

//process the file via the shell interpreter
system(&quot;sh /jobs/autoimage/autoimage.sh&quot;);
sleep(3);

//delete the shell file
unlink($shell);
</pre>
<p>Note that the above code is all passed to a file on the hard drive and then processed by the shell interpreter and then deleted. This has then created the image in the images folder that we can use to show as the site thumbnail. We then run it through a resize and crop function and then update the file with the updated image. We verify the image is not black (something may have failed) and if it isn&#8217;t it is moved into the production database and ties to the new sites account.</p>
<p>This goes to show that with a little thinking outside the box and using the systems at your disposal, anything can be done. You just have to be willing to try new things. This system has worked flawlessly since implementation and has been a great success. Thanks for reading and look back for more updates.  </p>
]]></content:encoded>
			<wfw:commentRss>http://michaelmaguire.info/2010/04/image_for_tutorialgrad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Launch &#8211; Welcome</title>
		<link>http://michaelmaguire.info/2010/04/site-launch-welcome/</link>
		<comments>http://michaelmaguire.info/2010/04/site-launch-welcome/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 15:58:44 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://michaelmaguire.info/?p=13</guid>
		<description><![CDATA[Welcome to my new site.]]></description>
			<content:encoded><![CDATA[<p>Hello to all readers. This is going to be a site where I list some things that I am working on and show you how some of the more advanced features that I have developed work. We will go into some detail about why these things work the way they do and why I chose to write them that way.  Let me know what your thoughts are and if you&#8217;d like to see anything special and thanks for viewing.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelmaguire.info/2010/04/site-launch-welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

