<?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>Ashley Ford - Tutorials :: jQuery :: PHP :: CSS :: HTML5 :: Papermashup.com &#187; Widgets</title>
	<atom:link href="http://papermashup.com/category/widgets/feed/" rel="self" type="application/rss+xml" />
	<link>http://papermashup.com</link>
	<description>Ashley Ford - Tutorials :: jQuery :: PHP :: CSS :: HTML5 :: Papermashup.com</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:28:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Google&#8217;s Weather API</title>
		<link>http://papermashup.com/using-googles-weather-api/</link>
		<comments>http://papermashup.com/using-googles-weather-api/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 16:46:58 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2471</guid>
		<description><![CDATA[I thought it would be a nice little project to write a tutorial on how to build a basic but powerful weather application for either mobile devices or the desktop. The application takes a set of Google weather API feeds &#8230; <br/> <a href="http://papermashup.com/using-googles-weather-api/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>I thought it would be a nice little project to write a tutorial on how to build a basic but powerful weather application for either mobile devices or the desktop. The application takes a set of Google weather API feeds and makes some simple decisions based on the output. For example we can recommend the user takes an umbrella if rain or storms are forecast, or whether the temperature warrants the need for warm clothes. Basic but nonetheless useful information.</p>
<h3>The Logic Code</h3>
<p>Lets have a quick run through at what the project consists of. Firstly we use the simplexml_load_file() PHP function to get the xml data for the given location. We then check to see if the current weather condition is in the XML file. If it doesn&#8217;t exist then we can make the assumption that the API feed couldn&#8217;t determine the location, bear in mind this is very basic error checking and if the feed fails it will still return this error.</p>
<p>We now do some basic data checking to to see what extra data we can give the user. Firstly we check on line 14 to see if the current weather and forecast are different, if they are different we&#8217;ll display the forecast if not we show just the current weather.</p>
<p>Next on lines 21 and 28 we do a simple check to see if the temperature is higher or lower than 20 degrees and echo whether it&#8217;s likely to be hot or cold. </p>
<p>Finally on lines 35 we check to see if the current or future forecast contains any rain or storms so we can recommend the user takes an umbrella. This is done using some basic PHP regular expression.</p>
<pre class="brush: php; title: ;">
	// load the XML feeds for the Google Weather API
	$xml = simplexml_load_file('http://www.google.com/ig/api?weather='.urlencode($_GET['location']));
	$current = $xml-&gt;xpath(&quot;/xml_api_reply/weather/current_conditions&quot;);
	$forecast = $xml-&gt;xpath(&quot;/xml_api_reply/weather/forecast_conditions&quot;);

	// do a basic error check to see if we can get the current weather condition for the given location
	// if no return an error.
	if(!$current[0]-&gt;condition['data']){

		$error = 'Couldn\'t determine this location';

		}

	// is the current weather the same as the forecast? if not display the forecast
	if(strtolower($current[0]-&gt;condition['data'])!=strtolower($forecast[0]-&gt;condition['data'])){

	$outlook = 'but the forecast says '.strtolower($forecast[0]-&gt;condition['data']);	

		}

	// if the temp in degrees c is below 20 i.e. cold
	if($current[0]-&gt;temp_c['data']&lt;=20){

	$coat = 'If you\'re going outside i\'d wrap up warm.';	

		}	

	// if the temp in degrees c is over 21 i.e. Warm / Hot
	if($current[0]-&gt;temp_c['data']&gt;=21){

	$coat = 'You should be ok without warm clothes today.';	

		}		

	// check to see if there is rain or storms forecast
	if (preg_match(&quot;/\brain\b/i&quot;, $current[0]-&gt;condition['data']) ||
		preg_match(&quot;/\brain\b/i&quot;, $forecast[0]-&gt;condition['data']) ||
		preg_match(&quot;/\bstorm\b/i&quot;, $current[0]-&gt;condition['data']) ||
		preg_match(&quot;/\bstorm\b/i&quot;, $forecast[0]-&gt;condition['data'])
		){

		$umbrella = ' But &lt;u&gt;don\'t forget to take an umbrella&lt;/u&gt;!';
		}
</pre>
<h3>Displaying the data</h3>
<pre class="brush: php; title: ;">
&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
&lt;label for=&quot;location&quot;&gt;Location&lt;/label&gt;
&lt;input type=&quot;text&quot; class=&quot;location&quot; name=&quot;location&quot; value=&quot;&lt;?php echo $_GET['location'];?&gt;&quot;/&gt;
&lt;/form&gt; 

&lt;?php if(!empty($_GET['location'])){

	if($error){ echo '&lt;div class=&quot;errors&quot;&gt;'.$error.'&lt;/div&gt;'; }else{

?&gt;

&lt;div class=&quot;weather_app&quot;&gt;

&lt;h1&gt;Weather Summary for &lt;?php echo $_GET['location'];?&gt;&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;?php echo '&lt;img src=&quot;http://google.com'.$current[0]-&gt;icon['data'].'&quot;/&gt;'; ?&gt; The weather in &lt;?php echo $_GET['location'];?&gt; is &lt;strong&gt;&lt;?php echo strtolower($current[0]-&gt;condition['data']).' '. $outlook;?&gt;&lt;/strong&gt;. The temperature is currently &lt;strong&gt;&lt;?php echo $current[0]-&gt;temp_c['data']; ?&gt;&amp;deg;c (&lt;?php echo $current[0]-&gt;temp_f['data']; ?&gt;&amp;deg;f)&lt;/strong&gt;. &lt;?php echo $coat;?&gt; &lt;?php echo $umbrella;?&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;?php } } ?&gt;
</pre>
<p><a href="http://papermashup.com/demos/google-weather-api/?location=Bristol"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="" title="demo" class="alignnone size-full wp-image-23" /></a> <a href="http://papermashup.com/demos/google-weather-api/google-weather-api.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="download" title="download" class="alignnone size-full wp-image-24" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/using-googles-weather-api/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Key web development skills</title>
		<link>http://papermashup.com/key-web-development-skills/</link>
		<comments>http://papermashup.com/key-web-development-skills/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 10:53:11 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[headline]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[MySpace]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Trends]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[Advertising]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Data Portability]]></category>
		<category><![CDATA[Del.icio.us]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=1198</guid>
		<description><![CDATA[API Knowledge A key tool for any budding web developer is API knowledge. It&#8217;s good to familiarise yourself with a variety of application interfaces. I started out using the Twitter REST API with PHP and CURL when twitter first launched &#8230; <br/> <a href="http://papermashup.com/key-web-development-skills/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<h3>API Knowledge</h3>
<p>A key tool for any budding web developer is API knowledge. It&#8217;s good to familiarise yourself with a variety of application interfaces. I started out using the Twitter REST API with PHP and CURL when twitter first launched the API to basically get a users tweets, pretty simple now I look back, but at the time it was the first time i&#8217;d done such a thing. As the development of social media continues this will increasingly open up opportunities to develop more and more applications that interact with one another and and make our daily chores more eventful.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/api.jpg" alt="api" title="api" width="582" height="200" /></p>
<h3>Frameworks</h3>
<p>There&#8217;s generally a framework for just about every programming language out there. Whether you decide to learn the jQuery framework for JavaScript or Cake for PHP each one will help you succeed as a freelancer and further your career as a web developer. Frameworks in many respects take out the arduous repetitive tasks we face daily and give us more time to focus on developing cutting edge products or applications. </p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/ruby.jpg" alt="ruby" title="ruby" width="582" height="200" /></p>
<h3>iPhone Applications</h3>
<p>Companies are Increasingly seeing the massive potential that there is in the mobile platform. Applications that are approved and make it into the Apple app store have the opportunity to be downloaded thousands of times and can potentially make a lot of money. Having a specific skill to be able to develop for this market can be very lucrative, especially in the current economic climate when companies are turning to social media to plug holes where they&#8217;re not seeing return on investment from other advertising sectors.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/iphone.jpg" alt="iphone" title="iphone" width="582" height="200" /></p>
<h3>CMS Customisation</h3>
<p>A handy skill to have is a general knowledge of how to use content management systems. For example building themes and plugins for WordPress, or modules and components for Joomla and Mambo.  As a developer its important to have an idea of the structure of a variety of CMS&#8217;s. If you have a wordpress blog/site, that&#8217;s an easy way to familiarise yourself with the platform. Remember it&#8217;s always easier to learn something by immersing yourself in the technology.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/wordpress.jpg" alt="wordpress" title="wordpress" width="582" height="200" /></p>
<h3>Online Payments</h3>
<p>Businesses are always going to need payment solutions online. Having the skills to take a site and integrate  paypal or google checkout will allow you to go far. We&#8217;re starting to see many 3rd party software companies setting up and selling software at more affordable prices, take <a href="http://www.panic.com/">Panic</a> for example. They are a relatively small company that develop a selection of web development software for the mac. Many new startups are settling for a product based revenue stream rather than making money purely through ads, revenue share, or partnership deals. This opens up the demand for skilled developers to be able to build payment solutions.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/google-checkout.png" alt="google-checkout" title="google-checkout" width="582" height="200"/></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/key-web-development-skills/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Does your office have a weather system?</title>
		<link>http://papermashup.com/does-your-office-have-a-weather-system/</link>
		<comments>http://papermashup.com/does-your-office-have-a-weather-system/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 20:41:48 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[headline]]></category>
		<category><![CDATA[ioBridge]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[weather]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=1166</guid>
		<description><![CDATA[I wrote a post a while back when I purchased my iobridge module which you can use to control switched and sensor. After that post I had my module rigged up in my office at home just monitoring the room &#8230; <br/> <a href="http://papermashup.com/does-your-office-have-a-weather-system/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>I wrote a post a while back when I purchased my <a href="http://papermashup.com/iobridge-module/">iobridge module</a> which you can use to control switched and sensor. After that post I had my module rigged up in my office at home just monitoring the room temperature and ambient light hourly, I wasn&#8217;t sure what i could do with this data at the time so using the Google Ajax API I <a href="http://papermashup.com/iobridge/">displayed the data using 2 graphs</a> purely as a bit of fun. Now i&#8217;ve decided to take it a stage further.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/10/bridge.png" alt="bridge" title="bridge" width="582" height="346"/></p>
<p>Using a feed from the BBC weather I&#8217;ve mashed up the data that i get from the temperature sensor with the weather feed to predict what the &#8216;weather&#8217; will be like in my office. As a feature for my site (as i spend most of my time in my office) you can see what the weather&#8217;s like in my office at anytime by clicking the link in the menu at the top right of any page. We&#8217;re approaching winter over here in the UK so the temperature is dropping.</p>
<p>I thought it was a different way of displaying this kind of data by making it a bit fun, and you never know i may extend it in the future to include other aspects. I have a light sensor which is in full operation, which can be seen from the <a href="http://papermashup.com/iobridge-module/">original mash-up here</a>.</p>
<p><a href="http://papermashup.com/iobridge/temp-site.php?keepThis=true&#038;TB_iframe=true&#038;height=450&#038;width=620" title="My Office Weather" onclick="return false;" class="thickbox">View The Latest Office Weather</a></p>
<p><a href="http://papermashup.com/iobridge/temp-site.php?keepThis=true&#038;TB_iframe=true&#038;height=450&#038;width=620" title="My Office Weather" onclick="return false;" class="thickbox"><img src="http://papermashup.com/wp-content/uploads/2009/10/weather.png" alt="weather" title="weather" width="582" height="346" /></a></p>
<p><a href="http://papermashup.com/iobridge/temp-site.php?keepThis=true&#038;TB_iframe=true&#038;height=450&#038;width=620" title="My Office Weather" onclick="return false;" class="thickbox"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="demo" title="demo"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/does-your-office-have-a-weather-system/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Build a MySpace video widget</title>
		<link>http://papermashup.com/build-a-myspace-video-widget/</link>
		<comments>http://papermashup.com/build-a-myspace-video-widget/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 07:24:24 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[headline]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySpace]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=1148</guid>
		<description><![CDATA[In this tutorial we&#8217;re going to take an RSS feed from the top videos page on MySpace and make a widget to display the latest videos using jQuery pagination, ajax and a spot of PHP to parse the feed. The &#8230; <br/> <a href="http://papermashup.com/build-a-myspace-video-widget/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we&#8217;re going to take an RSS feed from the <a href="http://vids.myspace.com/index.cfm?fuseaction=vids.charts">top videos page on MySpace</a> and make a widget to display the latest videos using jQuery pagination, ajax and a spot of PHP to parse the feed. The basic logic of what is going on is simple. We parse an XML file echo all the results, then we use the quick paginate plugin to display a select number of results with the option to browse pages.</p>
<p>Lets first take a look at the PHP page where we use CURL to parse the feed. You&#8217;ll need to make sure that your server has PHP5. Right at the top of the code we have the RSS feed source file stored in the variable $file, then the process section of code deals with the CURL request saving the result in the variable $data. We then use the Simple XmlElement to display the specific xml nodes in the right place.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/10/vids2.jpg" alt="vids2" title="vids2" width="582" height="219" /></p>
<h3>The PHP</h3>
<pre class="brush: php; title: ;">
	//source
	$file = 'http://mediaservices.myspace.com/services/rss.ashx?fuseaction=vids.charts&amp;amp;amp;RSSAction=VideoCharts';

	//process
	$ch = curl_init($file);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	$data = curl_exec($ch);
	curl_close($ch);

	//execute
	try
	{

	$i=0;

		$doc = new SimpleXmlElement($data, LIBXML_NOCDATA);
		function parseRSS($xml) {

			foreach($xml-&amp;amp;gt;channel-&amp;amp;gt;item as $entry) {
				$namespaces = $entry-&amp;amp;gt;getNameSpaces(true);
				$media = $entry-&amp;amp;gt;children($namespaces['media']);
				$myspace = $entry-&amp;amp;gt;children($namespaces['myspace']);
				$description = $entry-&amp;amp;gt;description;

	    $length = strlen($description);

	   if($length &amp;amp;gt; 20){
	   $description = substr($description, 0, 20).&amp;amp;quot;...&amp;amp;quot;;
	}

				if($entry-&amp;amp;gt;title) {
						if($odd = $i%2){$class='odd';}else{$class='even';}
					echo &amp;amp;quot;&amp;amp;lt;div class='vids &amp;amp;quot;.$class.&amp;amp;quot;'&amp;amp;gt;&amp;amp;quot;;
					echo '&amp;amp;lt;div class=&amp;amp;quot;left&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;a class=&amp;amp;quot;ms-video&amp;amp;quot; target=&amp;amp;quot;_top&amp;amp;quot; href=&amp;amp;quot;'.$entry-&amp;amp;gt;guid.'&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;img width=&amp;amp;quot;100&amp;amp;quot; border=&amp;amp;quot;0&amp;amp;quot; src=&amp;amp;quot;'.$media-&amp;amp;gt;thumbnail-&amp;amp;gt;attributes()-&amp;amp;gt;url.'&amp;amp;quot; alt=&amp;amp;quot;'.$entry-&amp;amp;gt;title.'&amp;amp;quot; /&amp;amp;gt;&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/div&amp;amp;gt;';
					echo '&amp;amp;lt;div class=&amp;amp;quot;right&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;div class=&amp;amp;quot;video-title&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;a class=&amp;amp;quot;ms-video&amp;amp;quot; target=&amp;amp;quot;_top&amp;amp;quot; href=&amp;amp;quot;'.$entry-&amp;amp;gt;guid.'&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;span&amp;amp;gt;'.$media-&amp;amp;gt;title.'&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/div&amp;amp;gt;';

					echo '&amp;amp;lt;div class=&amp;amp;quot;video-description&amp;amp;quot;&amp;amp;gt;'.$description.'&amp;amp;lt;/div&amp;amp;gt;';
				    echo  $myspace-&amp;amp;gt;statistics-&amp;amp;gt;attributes()-&amp;amp;gt;plays.' Plays&amp;amp;lt;/div&amp;amp;gt;';

					echo '&amp;amp;lt;div class=&amp;amp;quot;clear&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/div&amp;amp;gt;';
						echo &amp;amp;quot;&amp;amp;lt;/div&amp;amp;gt;&amp;amp;quot;;
				}

					$i++;
			//end foreach
			}

		}

		if(isset($doc-&amp;amp;gt;channel-&amp;amp;gt;item)) {
			parseRSS($doc);
		} else {
			#no videos;
			exit;
		}
	} catch (Exception $e) {
		echo 'Bad XML file.';
		exit;
	}
</pre>
<h3>The JavaScript</h3>
<p>This must be the simplest JavaScript widget I&#8217;ve ever written. The basis of this code is to load in the results of an ajax request in to a div then with the help of the<a href="http://projects.allmarkedup.com/jquery_quick_paginate/"> quick paginate jQuery plugin.</a>You can see below that you if you want to adjust the number of results on each page just change the 3 to what ever you like.</p>
<pre class="brush: jscript; title: ;">
&amp;amp;lt;script type=&amp;amp;quot;text/javascript&amp;amp;quot; src=&amp;amp;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/script&amp;amp;gt;
&amp;amp;lt;script src=&amp;amp;quot;quickpaginate.js&amp;amp;quot; type=&amp;amp;quot;text/javascript&amp;amp;quot; charset=&amp;amp;quot;utf-8&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/script&amp;amp;gt;
&amp;amp;lt;script type=&amp;amp;quot;text/javascript&amp;amp;quot; charset=&amp;amp;quot;utf-8&amp;amp;quot;&amp;amp;gt;

$(document).ready(function(){
$('#content').hide();
$('#content').load('videofeed.php', function(){
	$('#content').fadeIn('slow');
$('.vids').quickpaginate({ perpage: 3, pager : $(&amp;amp;quot;#pagination&amp;amp;quot;) });
 });
});
&amp;amp;lt;/script&amp;amp;gt;
</pre>
<p>You can use any RSS feed for this widget, you&#8217;ll just need to adjust the PHP file to accept a different feed.</p>
<p><a href="http://papermashup.com/demos/myspace-video-widget/"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="demo" title="demo"/></a><a href="http://papermashup.com/demos/myspace-video-widget/myspace-video-widget.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="download" title="download" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/build-a-myspace-video-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a dynamic form preview with jQuery</title>
		<link>http://papermashup.com/create-a-dynamic-form-preview/</link>
		<comments>http://papermashup.com/create-a-dynamic-form-preview/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 12:40:33 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Form]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=882</guid>
		<description><![CDATA[I recently had the need to build a dynamic form preview tool for work so clients could preview how the text and images would look before submitting the content to be published. I&#8217;ve trimmed down the code and removed the &#8230; <br/> <a href="http://papermashup.com/create-a-dynamic-form-preview/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>I recently had the need to build a dynamic form preview tool for work so clients could preview how the text and images would look before submitting the content to be published. I&#8217;ve trimmed down the code and removed the database part completely from this example so we can concentrate purely on the JavaScript. </p>
<div class="clear"></div>
<h3>The JavaScript</h3>
<pre class="brush: jscript; title: ;">
$(document).ready(function(){
$('#preview').hide();
$(&quot;#photo&quot;).click(update);
$(&quot;#title&quot;).keypress(update);
});

function update(){		

$('#preview').slideDown('slow');
var title = $(&quot;#title&quot;).val();
var photo = $(&quot;#photo&quot;).val();
$('#Displaytitle').html(title);
$('#image').html('&lt;img src=&quot;'+photo+'&quot;/&gt;');
}
</pre>
<h3>The HTML</h3>
<pre class="brush: xml; title: ;">

  &lt;div class=&quot;left&quot;&gt;
    &lt;form&gt;
      Choose a site&lt;br/&gt;
      &lt;select name=&quot;pic&quot; class=&quot;click&quot; id=&quot;photo&quot;&gt;
        &lt;option value=&quot;images/photo1.png&quot;&gt;Tweet.me.it&lt;/option&gt;
        &lt;option value=&quot;images/photo2.png&quot;&gt;Dotdashcreate.com&lt;/option&gt;
        &lt;option value=&quot;images/photo3.png&quot;&gt;Papermashup.com&lt;/option&gt;
      &lt;/select&gt;
      &lt;br/&gt;
      Add a Tagline
      &lt;textarea id=&quot;title&quot; class=&quot;click&quot; name=&quot;title&quot; cols=&quot;40&quot; rows=&quot;4&quot;&gt;This is your default advert text. &lt;/textarea&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;div class=&quot;right&quot;&gt;
    &lt;noscript&gt;
    This is where you could put a link for users who have JavaScript disabled to see a preview
&lt;/noscript&gt;
    &lt;div id=&quot;preview&quot;&gt; This is how your advert will look
      &lt;div id=&quot;image&quot;&gt;&lt;/div&gt;
      &lt;div id=&quot;Displaytitle&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</pre>
<p>In the dom ready function we&#8217;re simply hiding the div &#8216;#preview&#8217; as this is our container for the contents of our form preview. next we setup the &#8216;.click&#8217; and &#8216;.keypress&#8217; listeners that execute that function &#8216;update()&#8217; to display the preview of our form contents. Next looking at the &#8216;update()&#8217; function we firstly display the &#8216;#preview&#8217; div. Then set the variables &#8216;title&#8217; and &#8216;photo&#8217; with the values of the form using the &#8216;.val()&#8217; attribute. Then to update our form preview we use &#8216;.html()&#8217; to replace the contents of the selected div.</p>
<p><a href="http://papermashup.com/demos/widget-builder/"><img src="http://papermashup.com/wp-content/uploads/2009/07/form-preview.png" alt="form-preview" title="form-preview" width="529" height="207" class="alignnone size-full wp-image-894" /></a></p>
<blockquote>
<h3>Using .html .append &#038; .prepend</h3>
<p>Its useful to know that &#8216;.html&#8217; will replace the contents of the div with whatever you specify as shown below.</p>
<h4>.html()</h4>
<pre class="brush: xml; title: ;">
&lt;div id=&quot;replace&quot;&gt;This will be replaced&lt;/div&gt;

$('#replace').html('with this text');
</pre>
<p>You can however use &#8216;.prepend&#8217; and &#8216;.append&#8217; to add the new contents before or after the current contents as shown below.</p>
<h4>.append()</h4>
<pre class="brush: xml; title: ;">
&lt;div id=&quot;time&quot;&gt;The time is: &lt;/div&gt;

$('#time').append('12:00pm');
</pre>
<h4>.prepend()</h4>
<pre class="brush: xml; title: ;">
&lt;div id=&quot;time&quot;&gt; is the time&lt;/div&gt;

$('#time').prepend('12:00pm');
</pre>
</blockquote>
<p><a href="http://papermashup.com/demos/widget-builder/" target="_blank"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="demo" title="demo" /></a><a href="http://papermashup.com/demos/widget-builder/form-preview.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="download" title="download" class="alignnone size-full wp-image-24" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/create-a-dynamic-form-preview/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Creating an iframe with JavaScript</title>
		<link>http://papermashup.com/creating-an-iframe-with-javascript/</link>
		<comments>http://papermashup.com/creating-an-iframe-with-javascript/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 08:29:52 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[iframe]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=444</guid>
		<description><![CDATA[I want to start this post by saying that I&#8217;m not a fan of using iframes, however, sometimes due to restrictions within some development environments it may be the only way to embed content into your site of blog. So &#8230; <br/> <a href="http://papermashup.com/creating-an-iframe-with-javascript/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>I want to start this post by saying that I&#8217;m not a fan of using iframes, however, sometimes due to restrictions within some development environments it may be the only way to embed content into your site of blog.</p>
<p>So whats the point i hear you cry. This code is really only useful if your distributing and sharing widgets from your site. So say you have your own social network and you want to open up the data allow users to embed portions of your site on theirs, this code basically writes a standard iframe on the page using JavaScript, and instead of the user having to copy the whole iframe code (which can be long if you have inline-styles, and long source urls)  all you need to include in your page to invoke the widget is the code below.</p>
<pre>
<pre class="brush: xml; title: ;">
&lt;!-- one line of JavaScript is all that is needed to generate the iframe. --&gt;
&lt;script language=&quot;JavaScript&quot; src=&quot;/demos/javascript-iframe/javascript-iframe.js&quot;&gt;&lt;/script&gt;
</pre>
</pre>
<p>And within the javascript file is the following code.</p>
<pre>
<pre class="brush: jscript; title: ;">
// Set path to the iframe file
var filePath = 'http://www.myspace.com';
// Setup the iframe target
var iframe='&lt;iframe id=&quot;frame&quot; name=&quot;widget&quot; src =&quot;#&quot; width=&quot;100%&quot; height=&quot;1&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; frameborder=&quot;no&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;';
// Write the iframe to the page
document.write(iframe);

var myIframe = parent.document.getElementById(&quot;frame&quot;);
// Setup the width and height
myIframe.height = 350;
myIframe.width = 960;

myIframe.src = filePath;
// set the style of the iframe
myIframe.style.border = &quot;1px solid #999&quot;;
myIframe.style.padding = &quot;8px&quot;;
</pre>
</pre>
<p>And that&#8217;s it, any questions or comments leave them below.</p>
<p><a href="http://papermashup.com/demos/javascript-iframe.php"><img title="demo" src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="demo" /></a><a href="http://papermashup.com/demos/javascript-iframe/javascript-iframe.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="download" title="download"/></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/creating-an-iframe-with-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why widgets are important for your business</title>
		<link>http://papermashup.com/why-widgets-are-important-for-your-business/</link>
		<comments>http://papermashup.com/why-widgets-are-important-for-your-business/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 21:09:10 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Make]]></category>
		<category><![CDATA[Money]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=140</guid>
		<description><![CDATA[Widgets fit perfectly into a world where information makes it&#8217;s self available where ever the end user wants it. Widgets offer the great ability to be placed where the community will use it the most thus maximising a marketers message &#8230; <br/> <a href="http://papermashup.com/why-widgets-are-important-for-your-business/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-152" title="widgets" src="http://papermashup.com/wp-content/uploads/2009/01/widgets.jpg" alt="widgets" width="529" height="188" /></p>
<p>Widgets fit perfectly into a world where information makes it&#8217;s self available where ever the end user wants it. Widgets offer the great ability to be placed where the community will use it the most thus maximising a marketers message within the product.</p>
<p>Tracking widgets is easy with tools such as clearsprings and Gigya. These services allow users to virally spread your message throughout the net easily integrating your product in social networks and blogs. A site that&#8217;s bringing widget making to the masses is <a href="http://www.sproutbuilder.com">Sproutbuilder.com</a>. Just out of Beta Sprout gives you the ability to create rich media widgets like the one below. Sprout offers a really great user interface built completely in Flex it&#8217;s a great example of an online application. Allowing you to embed RSS feeds, Twitter feeds, Yahoo maps, Google Forms, and much more. Design and style are completely up to you which is great as most sites only offer drag and drop interfaces with pre-set placeholders for content. templates are available for the less adventurous. Check out the video below on how to create your sprout.</p>
<p><object width="529" height="373" data="http://farm.sproutbuilder.com/33833/load/wABXwB3zAT7HGCYK.swf" type="application/x-shockwave-flash"><param name="id" value="playerLoader" /><param name="quality" value="best" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent" /><param name="src" value="http://farm.sproutbuilder.com/33833/load/wABXwB3zAT7HGCYK.swf" /><param name="name" value="playerLoader" /><param name="align" value="middle" /><param name="allowfullscreen" value="true" /></object><img style="visibility: hidden; width: 0px; height: 0px;" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyMzIyMTkxMTQ3NTUmcHQ9MTIzMjIxOTE*MjEwNiZwPTEyMDc*MSZkPTcyOTg*Jmc9MiZ*PSZvPTI5M2Y4YWJjNmFhYzQ1ZDk4Njg4MzRlYzc*Yzg1Zjcz.gif" border="0" alt="" width="0" height="0" /></p>
<h2>Making money from widgets</h2>
<p>Widgets are a great environment for brand advertising as they offer a real media experience and in time brands can leverage that experience to find ways to engage users with their product. We are seeing more and more brands sponsoring already popular widgets to get their message across.</p>
<p>Sites like Amazon and Ebay offer users affiliate programs encouraging them distribute their widgets with products. This is a great marketing initiative by these companies to take their products off the site and onto the users sites and networks, and the incentive to embed the widget is cash to the site owner of a visitor buys a product. So everyone wins. This has been a brief look at widgets and how your business can use this emerging form of media to target your audience. </p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/why-widgets-are-important-for-your-business/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/

Page Caching using disk: enhanced
Database Caching 1/29 queries in 0.053 seconds using disk: basic
Object Caching 763/846 objects using disk: basic

Served from: papermashup.com @ 2012-02-04 03:26:23 -->
