<?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>Spicer Matthews &#187; Web 2.0</title> <atom:link href="http://www.spicermatthews.com/tag/web-2-0/feed/" rel="self" type="application/rss+xml" /><link>http://www.spicermatthews.com</link> <description>Random Thoughts By Spicer Matthews</description> <lastBuildDate>Wed, 09 Jun 2010 20:00:17 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>AudioBox &#8211; Real Cloud Based Music</title><link>http://www.spicermatthews.com/audiobox-real-cloud-based-music/</link> <comments>http://www.spicermatthews.com/audiobox-real-cloud-based-music/#comments</comments> <pubDate>Sun, 16 May 2010 19:55:44 +0000</pubDate> <dc:creator>Spicer</dc:creator> <category><![CDATA[Cloud Services]]></category> <category><![CDATA[audiobox]]></category> <category><![CDATA[music]]></category> <category><![CDATA[saas]]></category> <category><![CDATA[Web 2.0]]></category><guid
isPermaLink="false">http://www.spicermatthews.com/?p=199</guid> <description><![CDATA[When it comes to hardware and operating systems I am one of the biggest Apple fan boys out there. When it comes to software and control I am truly annoyed by Apple. As a side note I am an Apple share holder and I love what they do from a business stand point. Apple has held back music players for years. They released iTunes a long time ago and it blew all the music players out of the water. Back then compiled desktop based software was cool. Then they went full speed ahead with the Apple iTunes music store. This was amazing from a lets kill cd's standpoint.I have a library of music that I have gotten from all different sources; Amazon, iTunes, cd rips, and so on. I want to stuff all this music in one bloat free place and have it with me everywhere I go. If I am 100% an Apple user this place is iTunes, but I am not. I have an Android phone, a windows netbook, linux laptop, Apple desktop, Apple laptop. There is no easy way with iTunes to keep all these devices in sync when it comes to my music. Nor do I want my 13 Gig music stash living on all these devices. The service that was about to do all this was Lala.com until Apple purchased then and closed them down. <a
href="https://www.grooveshark.com">Grooveshark.com</a> has sort of done it but their way of doing things is a little odd and they use way to much flash.]]></description> <content:encoded><![CDATA[<p><img
alt="scr01 small AudioBox   Real Cloud Based Music" src="http://audiobox.fm/images/screenshots/scr01_small.png" title="Audiobox" class="alignright" width="212" height="80" /><br
/> When it comes to hardware and operating systems I am one of the biggest Apple fan boys out there. When it comes to software and control I am truly annoyed by Apple. As a side note I am an Apple share holder and I love what they do from a business stand point. Apple has held back music players for years. They released iTunes a long time ago and it blew all the music players out of the water. Back then compiled desktop based software was cool. Then they went full speed ahead with the Apple iTunes music store. This was amazing from a lets kill cds standpoint.</p><p>I have a library of music that I have gotten from all different sources; Amazon, iTunes, cd rips, and so on. I want to stuff all this music in one bloat free place and have it with me everywhere I go. If I am 100% an Apple user this place is iTunes, but I am not. I have an Android phone, a windows netbook, linux laptop, Apple desktop, Apple laptop. There is no easy way with iTunes to keep all these devices in sync when it comes to my music. Nor do I want my 13 Gig music stash living on all these devices. The service that was about to do all this was Lala.com until Apple purchased them and closed them down. <a
href="https://www.grooveshark.com">Grooveshark.com</a> has sort of done it but their way of doing things is a little odd and they use way to much flash.</p><p>Finally!!! <a
href="https://audiobox.fm">AudioBox</a> to the rescue!! AudioBox is a service that gives me a complete cloud-based music solution. I pay them a small fee and can upload all my music. I can play their music from any web browser. They have a mobile platform, and best of all they exposed an API that allows me to have complete control over my music collection. While I am sure the rumors that Apple is working on a cloud-based version of iTunes is true, I am 100% sure they are not going to give you complete control over your music nor are they going to make it very easy for me to use my music on non-apple devices.</p><p>Below is a little PHP script I wrote to mass up load my music to AudioBox. I am using AudioBox 100% from now on! I am sick of plugging my phone into my computer. I am sick of writing sync scripts to keep my mp3&#8242;s up-to-date on all my devices.</p><p><code><br
/> <?php<br
/> /*<br
/> By: Spicer Matthews <spicer@cloudmanic.com><br
/> Date: 5/16/2010<br
/> */</p><p>$email = 'user@example.org';<br
/> $pass = '**********';<br
/> $dir = '/my/music/folder';<br
/> foreach(get_filenames($dir) AS $key => $row)<br
/> {<br
/> if(preg_match('/.mp3/', strtolower($row)))<br
/> exec("curl -F media=@'$row' -u $email:$pass https://audiobox.fm/api/tracks");<br
/> }</p><p>//<br
/> // Get all file names in directory. (thanks CI - http://codeigniter.com/user_guide/helpers/file_helper.html)<br
/> //<br
/> function get_filenames($source_dir, $include_path = TRUE, $_recursion = FALSE)<br
/> {<br
/> static $_filedata = array();</p><p> if ($fp = @opendir($source_dir))<br
/> {<br
/> if ($_recursion === FALSE)<br
/> {<br
/> $_filedata = array();<br
/> $source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;<br
/> }</p><p> while (FALSE !== ($file = readdir($fp)))<br
/> {<br
/> if (@is_dir($source_dir.$file) &#038;&#038; strncmp($file, '.', 1) !== 0)<br
/> {<br
/> get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);<br
/> }<br
/> elseif (strncmp($file, '.', 1) !== 0)<br
/> {</p><p> $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;<br
/> }<br
/> }<br
/> return $_filedata;<br
/> }<br
/> }<br
/> ?><br
/> </code></p> ]]></content:encoded> <wfw:commentRss>http://www.spicermatthews.com/audiobox-real-cloud-based-music/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>My Love Of Jquery&#8217;s Form Plugin</title><link>http://www.spicermatthews.com/my-love-of-jquerys-form-plugin/</link> <comments>http://www.spicermatthews.com/my-love-of-jquerys-form-plugin/#comments</comments> <pubDate>Wed, 15 Apr 2009 22:11:10 +0000</pubDate> <dc:creator>Spicer</dc:creator> <category><![CDATA[Web Programing]]></category> <category><![CDATA[ajaxsubmit]]></category> <category><![CDATA[Form Plugin]]></category> <category><![CDATA[Jquery]]></category> <category><![CDATA[php]]></category> <category><![CDATA[Web 2.0]]></category><guid
isPermaLink="false">http://blog.spicermatthews.com/?p=20</guid> <description><![CDATA[The type of web programing I do often has a large database back-end with which requires user input and data return. In the olden days you just created an html form and then posted some input data to some cgi (say PHP script) and the script would speak with the database and return some html causing the browser to reload on post. Now that we are a super cool web 2.0 world we do not do this anymore we make javascript use Ajax to do the post for us. If you are anything like me you take one look at javascript and say "no thank you". Most people hate the syntax of javascript, the confusion of the language, or the browser compatibility issues; when I say most people I am including me. This is where our friends at Jquery come to the rescue  <a
href="http://jquery.com">http://jquery.com</a> (more on them in another post).]]></description> <content:encoded><![CDATA[<p>The type of web programing I do often has a large database back-end with which requires user input and data return. In the olden days you just created an html form and then posted some input data to some cgi (say PHP script) and the script would speak with the database and return some html causing the browser to reload on post. Now, that we are a super cool web 2.0 world we do things differently. We make our friend javascript use Ajax to do the post for us. If you are anything like me you take one look at javascript and say &#8220;no thank you&#8221;. Most people hate the syntax of javascript, the confusion of the language, or the browser compatibility issues; when I say most people I am including me. This is where our friends at Jquery come to the rescue <a
href="http://jquery.com">http://jquery.com</a> (more on them in another post).</p><p>For now I want to highlight a jquery plugin, an additional library that grows the functionality of jquery.  The Form Plugin <a
href="http://www.malsup.com/jquery/form">(Hosted Here)</a> allows jquery to submit form data via Ajax either when the user hits submit using the ajaxForm() or on demand using ajaxSubmit(). Here is an example of how I used it in a recent project.</p><p>index.php -</p><p><code></p><form
id="control-form" action="returnGraph.php" method="post"> <input
name="graphid" type="hidden" value="88" /> <input
id="date" name="date" type="text" /> <select
name="type"><option
value="Volume">Volume</option><option
value="Speed">Speed</option><option
value="Pace">Pace</option> </select> <input
name="title" type="text" /></form><div
id="graph-return"></div><p></code></p><p>So from the above html code you can see there is no submit button. Our goal here is to make it so when you change anyone of the input form items it will collect the value of each field and post the data to returnGraph.php. The data will be posted via Ajax so there is no page refresh. We want Ajax to change the graph and put the graph in the div with id &#8220;graph-return&#8221;. We also want some sort of spinner to spin to show the user the browser is thinking and waiting for a graph to appear. We are going to put an animated gif in the graph div that will be replaced with the graph when it is returned from returnGraph.php.</p><p>The next step is the write some javascript. You need to make sure you have the jquery and form plug in included in your code.<br
/> <br
/> <code><br
/> <script type="text/javascript" src="../javascript/jquery-1.2.6.pack.js"></script><br
/> <script type="text/javascript" src="../javascript/jquery.form.js"></script><br
/> </code><br
/></p><div>Here is the Javascript  I use to bind to the form to make the Ajax call and to also bind to the input items to make a post on change.</div><div></p><div>// This function will deal with Chart controls.</div><div>function setupControls()</div><div>{</div><div>// Setup Date Picker</div><div>$(&#8220;#date&#8221;).datepicker({</div><div>mandatory: true,</div><div>dateFormat: &#8220;M d, yy&#8221;,</div><div>showOn: &#8220;both&#8221;,</div><div>maxDate: &#8220;1&#8243;,</div><div>buttonImage: &#8220;../images/calendar.gif&#8221;,</div><div>buttonImageOnly: true,</div><div>onSelect: function (date) {</div><div>resubmitGraph();</div><div>}</div><div>});</div><p></p><div>// Setup a generic bind to bind all input fields to get a new graph</div><div>$(&#8220;#control-form :input&#8221;).change(resubmitGraph);</div><div>}</div><div></p><div>// This function will get the value of each control and submit an ajax form request to reder new</div><div>// graph.</div><div>function resubmitGraph()</div><div>{</div><div>$(&#8220;#control-form&#8221;).ajaxSubmit({</div><div>beforeSubmit: function () {</div><div>$(&#8220;#graph-return&#8221;).html(&#8216;&lt;div class=&#8221;loading1&#8243; style=&#8221;margin: 20% 0 0 45%;&#8221;&gt;&lt;/div&gt;&#8217;);</div><div>},</div><div>success: function (response) {</div><div>$(&#8220;#graph-return&#8221;).html(response);</div><div>}</div><div>});</div><div>}</div><p></p><div>I will not cover what datepicker is but it is part of the jquery ui plugin. I will cover this in a later post. <a
href="http://jqueryui.com">Jquery UI</a></div><p></p><div>The function resubmitGraph() is where all the magic happens. It does something call seralize the form data. It goes through each input form field creates a php post string. Here is an example unrelated to my example. I got it from here <a
href="http://www.malsup.com/jquery/form/#code-samples">Here</a></div><p>Now in the background the ajaxSubmit() function sends the serialized form Post to returnGraph.php. Also, just before posting we clear the &#8220;graph-return&#8221; div and put an automated gif in place to let the user know something is happening. Once the script is done processing the data it will call the &#8220;success&#8221; part ajaxSubmit() and pass in the response from the post. In our case it is a graph. The animated gif is replaced with the graph. Ajax Submit complete.</p><p>From the code below you can see we bind a change action to each input item in the form. So anytime anything changes in the fields we redraw the graph.<br
/> <code><br
/> $(”#control-form :input”).change(resubmitGraph);<br
/> </code><br
/></p></div></div> ]]></content:encoded> <wfw:commentRss>http://www.spicermatthews.com/my-love-of-jquerys-form-plugin/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 8/18 queries in 0.016 seconds using disk

Served from: www.spicermatthews.com @ 2010-09-09 17:23:46 -->