<?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>Michaelbox &#187; web development</title>
	<atom:link href="http://michaelbox.net/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelbox.net</link>
	<description>A container of ideas, creativity, passions, and adventures</description>
	<lastBuildDate>Fri, 11 May 2012 20:19:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Getting Social with Postscript5</title>
		<link>http://michaelbox.net/2011/08/23/getting-social-with-postscript5/</link>
		<comments>http://michaelbox.net/2011/08/23/getting-social-with-postscript5/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 20:41:07 +0000</pubDate>
		<dc:creator>tw2113</dc:creator>
				<category><![CDATA[Hogwarts]]></category>
		<category><![CDATA[Web Design-Development]]></category>
		<category><![CDATA[Grace Smith]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://michaelbox.net/?p=266</guid>
		<description><![CDATA[  Warning, long post The introduction If you have ever seen my twitter interaction with then you know that we are pretty endearing to each other as friends and colleagues in the world of freelance. Over the past few years that we’ve known of each other, we have grown to trust each other and rely [...]]]></description>
			<content:encoded><![CDATA[<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Getting Social with Postscript5 on Michaelbox',url: 'http://michaelbox.net/2011/08/23/getting-social-with-postscript5/',contentID: 'post-266',suggestTags: 'Grace Smith,howto,social media,web development',providerName: 'Michaelbox',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear"> </div>
</div><p>Warning, long post</p>

<h3>The introduction</h3>
<p>If you have ever seen my twitter interaction with <a href="http://twitter.com/gracesmith" title="gracesmith's Twitter profile">Grace Smith</a> then you know that we are pretty endearing to each other as friends and colleagues in the world of freelance. Over the past few years that we’ve known of each other, we have grown to trust each other and rely on the other’s professionalism and knowledge in our respective areas of expertise. Needless to say, we knew we’d work together professionally eventually, it was simply always a question of when.</p><span id="more-266"></span>

<p>Grace knew that her professional portfolio website needed a facelift in 2011. However, like with a lot of freelance professionals, personal projects tend to get the back seat frequently to incoming client work. This, she realized, opened the door for her bring myself into the mix and finally get us working on a project together. Grace proceeded to get the site to a certain point within her skills and knowledge, and then created a spec list of more advanced functionality that she had always desired for her site. The topic of this post was not one of her original requests. The “social” page was an idea that I brought to the table due to my desire to tinker and play with social media <a href="http://en.wikipedia.org/wiki/Application_programming_interface#Web_APIs" title="Web API on Wikipedia">APIs</a>. Grace ended up loving the idea of a single page showing her activity on many websites and gave me the green-light to have some fun and see what comes to fruition.</p>

<h3>The Implementation</h3>
<p>The files and code that I’m going to discuss are not the original implementation, but are what is live on <a href="http://postscript5.co.uk/socialise" title="Postscript5 Socialise page">Postscript5 Socialise page</a> at the moment. I have taken only the relevant code/markup from the socialise page, as the rest is just a WordPress template for the page. I’m sure there is room for more consistency but I’m going to call that a work in progress.</p>

<h4>Text files with the code. Viewing these directly may be easier to read than the Pre tags I’ll use below.</h4>
<p><a href='http://michaelbox.net/wp-content/images/socialmediapage.txt'>Socialise page code</a></p>
<p><a href='http://michaelbox.net/wp-content/images/ps5socialclass.txt'>PHP Classes for Twitter/Dribbble</a></p>

<h4>Retrieving our data</h4>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ps5socialclass.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Twitter</span>
    <span style="color: #000088;">$twitter</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Twitter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$tweets</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTweets</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gracesmith'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweet-list'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Dribbble</span>
    <span style="color: #000088;">$dribbble</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Dribbble<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$shots</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dribbble</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getShots</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gracesmith'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dribbble-shots'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Google+</span>
    <span style="color: #000088;">$googledata</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;https://plus.google.com/_/stream/getactivities/?&amp;sp=[1,2,'117113113218324562969',null,null,10,null,'social.google.com',[]]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//remove excess stuff</span>
    <span style="color: #000088;">$gplus</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;)]}'&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$googledata</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$gplus</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[,'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">'[&quot;&quot;,'</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$gplus</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$gplus</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">',,'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">',&quot;&quot;,'</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$gplus</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$gplus</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">',,'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">',&quot;&quot;,'</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$gplus</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$gplus_data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gplus</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Sc.ripted</span>
    <span style="color: #000088;">$scriptedfeed</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://sc.ripted.com/rss'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//gracesmith.co.uk</span>
    <span style="color: #000088;">$blogfeed</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://feeds2.feedburner.com/gracesmith'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//last.fm</span>
    <span style="color: #000088;">$lastfm</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://ws.audioscrobbler.com/1.0/user/postscript5/recenttracks.rss'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Flickr     </span>
    <span style="color: #000088;">$flickr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&amp;format=json&amp;api_key=KEY_HIDDEN&amp;user_id=27475012@N06&amp;per_page=3&amp;nojsoncallback=1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$photoset</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$flickr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$flickr</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photos</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$thepic</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    			<span style="color: #000088;">$picid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$thepic</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">;</span>
    			<span style="color: #000088;">$photoset</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&amp;api_key=KEY_HIDDEN&amp;photo_id=<span style="color: #006699; font-weight: bold;">$picid</span>&amp;format=json&amp;nojsoncallback=1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span></pre></div></div>




<p>Most of this should be pretty easy to follow. I am using file_get_contents() to pull in our data from the various APIs and RSS feeds, with the exception of Twitter and Dribbble. I stuck with <a href="http://en.wikipedia.org/wiki/JSON" title="JSON on Wikipedia">JSON</a> when possible, but it wasn’t available for everything that Grace wanted.</p>

<p>Google+ doesn’t have a proper API quite yet, but searching around showed various methods to get a person’s public stream in JSON format, after a bit of cleanup. That explains the multiple str_replace() calls. Once one gets publicly released, I hope to return to the Socialise page and alter the working code.</p>

<p>Flickr didn’t offer a direct way, that I could see at least, to pull the actual image URLs from a person’s public stream. So I looked over their documentation and found that I could construct the necessary url with the Public Photo stream information and a second API call with each photo’s information. This allowed me to complete what you see on the page and get thumbnail versions of her three latest pictures.</p>

<p>Now that I had all of this information in arrays or objects, I could start to loop through them all and output the appropriate markup.</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;twitter&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweets</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon&quot;&gt;
				&lt;a href=&quot;http://www.twitter.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$tweets</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">screen_name</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Twitter Profile&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Twitter-Social.png&quot; alt=&quot;Twitter icon&quot; /&gt;&lt;/a&gt;
			&lt;/div&gt;
&nbsp;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweets</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;div class=&quot;fake_lemon_quotes&quot;&gt;
&nbsp;
			&lt;p class=&quot;thetweet&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">text</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;br/&gt;
			- &lt;a href=&quot;http://www.twitter.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">screen_name</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/status/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> human_time_diff<span style="color: #009900;">&#40;</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">created_at</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' ago'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/p&gt;
&nbsp;
			&lt;/div&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> 
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon error&quot;&gt;
&nbsp;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Twitter-Social.png&quot; alt=&quot;Twitter icon&quot; /&gt;
&nbsp;
			&lt;/div&gt;
&nbsp;
			&lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with Twitter. Hopefully we'll be back shortly&lt;/p&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/div&gt;
&nbsp;
&nbsp;
&nbsp;
    &lt;div class=&quot;flickr&quot;&gt;
    	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$flickr</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    		&lt;div class=&quot;social_icon&quot;&gt;
    			&lt;a href=&quot;http://www.flickr.com/people/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$flickr</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photos</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">owner</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Flickr Profile&quot;&gt;
    			&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Flickr-Social.png&quot; alt=&quot;Flickr icon&quot; /&gt;&lt;/a&gt;
    		&lt;/div&gt;
&nbsp;
    		&lt;div class=&quot;flickrset&quot;&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$photoset</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$photo</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				&lt;div class=&quot;flickrimg <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'lastshot'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&nbsp;
					&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">urls</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span>_content<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">-&gt;</span>_content<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
					&lt;img src=&quot;http://farm<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">farm</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>.static.flickr.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">server</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">secret</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>_m.jpg&quot; class=&quot;flickrpreview&quot; alt=&quot;Flickr image preview&quot; /&gt;&lt;/a&gt;
&nbsp;
					&lt;p&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">urls</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span>_content<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;flickrlink&quot; title=&quot;Shot URL&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">-&gt;</span>_content<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt; 
					&lt;span class=&quot;datetaken&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;j M&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dates</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">posted</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/p&gt;
&nbsp;
				&lt;/div&gt;
&nbsp;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;/div&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon error&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Flickr-Social.png&quot; alt=&quot;Flickr icon&quot; /&gt;
			&lt;/div&gt;
			&lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with Flickr. Hopefully we'll be back shortly&lt;/p&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;/div&gt;
&nbsp;
&nbsp;
&nbsp;
    &lt;div class=&quot;theblog&quot;&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$blogfeed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXmlElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$blogfeed</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$posts</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon&quot;&gt;
				&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/WP-Social.png&quot; alt=&quot;Blog icon&quot; /&gt;&lt;/a&gt;
			&lt;/div&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$posts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
            	&lt;p class=&quot;blogitem&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;br/&gt;
&nbsp;
            	- &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guid</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink to <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Permalink&lt;/a&gt;&lt;/p&gt;
&nbsp;
            	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
&nbsp;
            	<span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon error&quot;&gt;
&nbsp;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/WP-Social.png&quot; alt=&quot;Blog icon&quot; /&gt;
&nbsp;
			&lt;/div&gt;
&nbsp;
            &lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with the blog feed. Hopefully we'll be back shortly&lt;/p&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;/div&gt;
&nbsp;
&nbsp;
&nbsp;
	&lt;div class=&quot;googleplus&quot;&gt;
&nbsp;
    	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gplus_data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    		<span style="color: #000088;">$gplus_data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$gplus_data</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	        	&lt;div class=&quot;social_icon&quot;&gt;
    	    		&lt;a href=&quot;http://plus.google.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$gplus_data</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">16</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/posts&quot; title=&quot;Google+ Profile&quot;&gt;
    	    	&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Google-Social.png&quot; alt=&quot;Google+ Icon&quot; /&gt;&lt;/a&gt;
&nbsp;
				&lt;/div&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gplus_data</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$plus</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				&lt;p class=&quot;pluses&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$plus</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">20</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;br/&gt;
&nbsp;
				- &lt;a href=&quot;https://plus.google.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$plus</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">21</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink to <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$plus</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">20</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Permalink&lt;/a&gt;&lt;/p&gt;
&nbsp;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;div class=&quot;social_icon error&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Google-Social.png&quot; alt=&quot;Google+ Icon&quot; /&gt;
			&lt;/div&gt;
&nbsp;
			&lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with Google+. Hopefully we'll be back shortly&lt;/p&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;/div&gt;
&nbsp;
&nbsp;
&nbsp;
    &lt;div class=&quot;scripted&quot;&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$scriptedfeed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXmlElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$scriptedfeed</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$scriptedposts</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon&quot;&gt;
				&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Tumblr-Social.png&quot; alt=&quot;Blog icon&quot; /&gt;&lt;/a&gt;
			&lt;/div&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$scriptedposts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$scripted</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
            		<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;: &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$scripted</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #000088;">$description</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$description</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #000088;">$description</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$description</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            	<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
            	&lt;p class=&quot;scripteditem&quot;&gt;&lt;span class=&quot;scriptedtitle&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$description</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; - <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$description</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;br/&gt;
&nbsp;
            	- &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$scripted</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guid</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink to <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$scripted</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> on Sc.ripted&quot;&gt;Permalink&lt;/a&gt;&lt;/p&gt;
&nbsp;
            	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
&nbsp;
            	<span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon error&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Tumblr-Social.png&quot; alt=&quot;Blog icon&quot; /&gt;
			&lt;/div&gt;
&nbsp;
            &lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with the Sc.ripted feed. Hopefully we'll be back shortly&lt;/p&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;/div&gt;
&nbsp;
	&lt;div class=&quot;dribbble&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$shots</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon&quot;&gt;
				&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$shots</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">shots</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">player</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Dribbble Profile&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Dribbble-Social.png&quot; alt=&quot;Dribbble Avatar&quot; /&gt;&lt;/a&gt;
			&lt;/div&gt;
&nbsp;
			&lt;!--The Lemon would be dunking on you--&gt;
&nbsp;
			&lt;div class=&quot;points&quot;&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
			<span style="color: #000088;">$myshots</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$shots</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">shots</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myshots</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$shot</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				&lt;div class=&quot;shots <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'lastshot'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&nbsp;
				&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$shot</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">short_url</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$shot</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$shot</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">image_teaser_url</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;shotpreview&quot; alt=&quot;Shot preview&quot; /&gt;&lt;/a&gt;
&nbsp;
				&lt;p&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$shot</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">short_url</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;shotlink&quot; title=&quot;Shot URL&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$shot</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/p&gt;
&nbsp;
				&lt;/div&gt;
&nbsp;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;/div&gt;
&nbsp;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;div class=&quot;social_icon&quot;&gt;
&nbsp;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/Dribbble-Social.png&quot; alt=&quot;Dribbble Avatar&quot; /&gt;
&nbsp;
			&lt;/div&gt;
&nbsp;
			&lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with Dribbble. Hopefully we'll be back shortly&lt;/p&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	&lt;/div&gt;
&nbsp;
	&lt;div class=&quot;lastfm&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lastfm</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXmlElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lastfm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$songs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;div class=&quot;social_icon&quot;&gt;
&nbsp;
				&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">channel</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&nbsp;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/LastFM-Social.png&quot; alt=&quot;Last.fm icon&quot; /&gt;&lt;/a&gt;
&nbsp;
			&lt;/div&gt;
&nbsp;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$songs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$song</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$counter</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;p class=&quot;songlisting&quot;&gt;Listened to: <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$song</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;br/&gt;
				- &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$song</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink to <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$song</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Permalink&lt;/a&gt;&lt;/p&gt;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
&nbsp;
            	<span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;social_icon error&quot;&gt;
				&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/socialicons/LastFM-Social.png&quot; alt=&quot;Last.fm icon&quot; /&gt;
			&lt;/div&gt;
			&lt;p&gt;We're sorry, we seem to be experiencing some technical difficulties with Last.fm. Hopefully we'll be back shortly&lt;/p&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/div&gt;</pre></div></div>




<p>Hopefully this is also pretty self exclamatory. I either started looping through the data, or further manipulated the data with <a href="http://php.net/manual/en/class.simplexmlelement.php" title="SimpleXMLElement">SimpleXMLElement</a> for easier looping through the RSS feeds. A lot of the loops above include a counter because they didn’t offer a limit parameter and we only needed the latest post, or in the cases of Dribbble and Flickr, the latest 3 pictures. Each icon on the left of Grace’s socialise page links to her profile page, and then the right shows the latest message/item/pictures. I also included a general error message for each one in case there were any difficulties with retrieving the data.</p>

<h3>But wait! You forgot to explain what’s going on with Twitter and Dribbble!</h3>

<p>Ah yes, Twitter and Dribbble. On top of my interest in APIs, I have also recently formed interest in Object-orientated Programming in PHP, and viewed this as a chance to try my hand at it a bit more.</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Twitter <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$twitter_api_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://api.twitter.com/1/statuses/user_timeline.json?screen_name='</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getTweets<span style="color: #009900;">&#40;</span><span style="color: #000088;">$twitter_username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trans_name</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$twitter_username</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'Error, you have not provided a Twitter username.'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">===</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweets</span> <span style="color: #339933;">=</span> get_transient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">storeCache</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$twitter_username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trans_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">readCache</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> readCache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> get_transient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> storeCache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$twitter_username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trans_name</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$tweets</span> <span style="color: #339933;">=</span> wp_remote_get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">twitter_api_url</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$twitter_username</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;include_rts=1&amp;count='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$tweettext</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweets</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		set_transient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tweettext</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">class</span> Dribbble <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$dribbble_api_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://api.dribbble.com/players/'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getShots<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dribbble_username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trans_name</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dribbble_username</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'Error, you have not provided a Dribbble username.'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">===</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$shots</span> <span style="color: #339933;">=</span> get_transient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">storeCache</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dribbble_username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">readCache</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> readCache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> get_transient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> storeCache<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dribbble_username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trans_name</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$shots</span> <span style="color: #339933;">=</span> wp_remote_get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dribbble_api_url</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$dribbble_username</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/shots'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$shotstext</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$shots</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		set_transient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$trans_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$shotstext</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>




<p>The way that both Twitter and Dribbble work on the Socialise page is to initialize a new instance from the class, and then call the getTweets() and getShots() functions within the classes. Both of these functions utilize the WordPress <a href="http://codex.wordpress.org/Transients_API" title="Transients API">Transients API</a> to help with caching. So to pull the data for the user, you pass in the user ID, the name you want to use for the transients field in the Options table, and in the case of Twitter, how many tweets you want to retrieve. The classes will check to see if their is any valid cache stored. If there is none, it will make a new API call and set a new cache instance. If there is a valid cache record, it will simply pull that and not touch the API. The Twitter cache is set to expire every 5 minutes, since Grace tends to be a lot more active there than on Dribbble, which has a cache time of 3 days</p>

<p>Hopefully this makes sense to those with PHP experience. However, I’m sure not everyone who reads this will have a lot of experience, so if you have any questions regarding how any of it works, please ask in the comment section. I’ll do what I can to help clarify.</p>

<p>I know that I had fun with coding the socialise page and definitely learned new things in the process. Based on feedback from Grace and from my own twitter stream, the socialise page has been one of the most loved parts of Grace’s re-launched site, right up next to the custom 404 page with 30 Rock’s Liz Lemon.</p>]]></content:encoded>
			<wfw:commentRss>http://michaelbox.net/2011/08/23/getting-social-with-postscript5/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Do You Think You Know Michael Beckwith?</title>
		<link>http://michaelbox.net/2010/08/18/everyone-elses-interview-with-me/</link>
		<comments>http://michaelbox.net/2010/08/18/everyone-elses-interview-with-me/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 15:58:20 +0000</pubDate>
		<dc:creator>tw2113</dc:creator>
				<category><![CDATA[Adventures]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[myself]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://michaelbox.net/?p=203</guid>
		<description><![CDATA[  No way do you know me! Ok maybe you do. I do what I can to express a lot and always make people laugh, even in the toughest of times. This interview is a special one that I decided to do back in the early days of the interview post idea. It’s done in [...]]]></description>
			<content:encoded><![CDATA[<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Do You Think You Know Michael Beckwith? on Michaelbox',url: 'http://michaelbox.net/2010/08/18/everyone-elses-interview-with-me/',contentID: 'post-203',suggestTags: 'interview,myself,web development,wordpress',providerName: 'Michaelbox',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear"> </div>
</div><p><img src="http://michaelbox.net/wp-content/images/littleme.jpg" alt="" title="littleme" width="182" height="314" class="alignright size-full wp-image-204" />No way do you know me! Ok maybe you do. I do what I can to express a lot and always make people laugh, even in the toughest of times. This interview is a special one that I decided to do back in the early days of the interview post idea. It’s done in conjunction with my 27th birthday today. All of the questions, except one, are submitted to me from the people you’ve already met in this blog series, as well as a small handful from others on twitter. I appreciate all of them spending some time to suggest one or three. Lets get to it, I’m getting sappy.</p>
<span id="more-203"></span>

<h3>If Hollywood made a movie about your life, whom would you like to
see play the lead role as you and why?</h3>

<p><span class="interviewee">Michael Beckwith</span>: Mary Elizabeth Winstead so that I’d be considered really f’n hot for once.</p>

<p>Oh, I have to stick to the appropriate gender? OK. Hmm..Joseph Gordon-Levitt. I have always enjoyed his work, from my time in high school watching <a href="http://www.imdb.com/title/tt0147800/" title="10 Things I Hate About You">10 Things I Hate About You</a> to my recent time realizing how great of a show <a href="http://www.imdb.com/title/tt0115082/" title="3rd Rock From The Sun">3rd Rock From The Sun</a> was. He has also shown a lot of serious acting chops the past number of years as he’s matured. If JGL wasn’t available, I’d have to go with Yahoo Serious, famous Australian actor/writer/director of such films like <a href="http://www.imdb.com/title/tt0096486/" title="Young Einstein">Young Einstein</a> and <a href="http://www.imdb.com/title/tt0107930/" title="Reckless Kelly">Reckless Kelly</a>. The reason for choosing Yahoo is because I recall growing up at a really young age watching Young Einstein when it came on tv. Very satirical and funny take on Einstein’s life, including splitting a beer atom to discover E=mc^2. Love it</p>

<h3>What would I find in your refrigerator right now?</h3>

<p><span class="interviewee">Michael</span>: Due to the fact that I have not really gone grocery shopping lately, especially for things that need to remain cold, not much. Bit of milk, your usual condiments. My freezer however…a ham, some small cuts of beef, hot dogs, breakfast sausage. I used to have some bacon, but I eated it!</p>

<p>I should really invest in a shopping trip.</p>

<h3>When it comes to building WordPress themes, what is your absolute favorite feature / capability / tag?</h3>

<p><span class="interviewee">Michael</span>: I guess I don’t really have a specific love of a feature/capability/whathaveyou, but I have noticed that I enjoy the challenge of a client wanting some sort of specific functionality and me being the person in charge of making it work. The idea of determining what information I need, how to retrieve that information, what to do with it, achieving that need, and then outputting the result. A lot of it is php and programming logic, but when it comes to WordPress themes, half the work tends to be done already through the built-in functions, making it somewhat entry level programming. However, you still need to know what functions you need to achieve these results, and how to make the functions format the information to fit your need. Other than that, just seeing all the areas of the theme working the way the designer and the client envisioned and requested. When that is true and the code is good, then I know I did my job.</p>

<p>I recently had a job interview for a “web developer” position for a local company, but they told me it’d be a lot of PSD to WordPress theme development. As soon as I heard that fact, I knew I wanted the position and that it’d be along my knowledge and current skill set. I should hear about if I landed the job or not this week, if I haven’t already by the time this post goes up.</p> 

<h3>What is one thing that you have learned in the real world that contradicts what “they” taught you in school?</h3>

<p><span class="interviewee">Michael</span>: Given the fact that my alumnus was big with Microsoft and taught a lot of their stuff, probably that Internet Explorer is a decent browser. Whether actually spoken or implied, I forget.</p>

<h3>What is the very first thing you learned in college?</h3>

<p><span class="interviewee">Michael</span>: While some would argue that learning that at some point I’d get to use Microsoft Frontpage later in my first semester of Intro To Computers 101, should be the first thing I learned(and the first thing I should have wished to change), I’m going to not go with that one. Others would argue that it’d be my first chance to really learn how to live on my own and be away from my parents. While definitely true for a decent amount of incoming freshmen, my brother and I spent the summer living on our own in a (really) small apartment about an hour away from our hometown. It was far away enough to be “away from the parents” but close enough that they could easily check up on us in person if needed.</p>

<p>No, none of those are the first thing that I learned in college. I am going to go with what I learned in English 101, much to the initial annoyance to my teacher. The very first thing that I learned in college is that I no longer had to ask if I could go to the bathroom. I was allowed to just go.</p>

<h3>What is your single most desired quality in a client? The single most hated?</h3>

<p><span class="interviewee">Michael</span>: For most desired? I won’t be alone in this one, but having the client comprehend and understand that, unlike their nephew/son/family member offering to do things for free, they hire the designers and developers because those people know what they are doing and have been doing it for usually many years on professional levels.</p>

<p>They need to learn to put their trust into the people they are hiring. Chances are the designer/developer isn’t going to try and screw the client over, because they want to earn their worth on the project as well as a decent living like everyone else. You know, one of those things called a career. Also, the designer/developer is going to want to produce work that is going to, hopefully, bring in more work in the future from either the same client(unless a really bad experience happens), or new clients.</p>

<p>For most hated? Going based on a previous WordPress project I was commissioned for: unavailability. If you know you are going to be unavailable for a period of time during the duration of the hired project, let the people you hire know that it will happen ahead of time. Don’t just suddenly pick up and go for awhile, while they’re trying to work on the project and may need to contact you. Also if you know you’re going to be gone, ask ahead of time what material or information the designers/developers need in order to get the project going steadily, and provide as much as you can before you leave. It’s really difficult to work on detailed style presentation when you have no example content to put in the work-in-progress site.</p>

<h3>What has been your biggest accomplishment?</h3>

<p><span class="interviewee">Michael</span>: Hopefully something not done yet! Other than that, I’m going to list being trusted my whole life to learn how to survive and make my own way through it, while always having my parents if I need them. They have really been wonderful and put their trust in me at ages that most parents would not. For that I’m always eternally grateful for them for letting me become the man I am today.</p>

<h3>How do you spend your days off?</h3>

<p><span class="interviewee">Michael</span>: Admittedly, I really lack a good solid social life. On top of that, I am currently not at a point in my eventual career that I’d like to be at. I am still trying to get my foot in the door on a local level. I have come to reason that an office-style job would not be a bad thing for me, so a lot of my off-time from my day job is spent trying to stay caught up in some very fast moving industries, and doing what I can on a freelance level to shape and evolve my portfolio. I am a pack rat when it comes to magazines, and lately you can see me somewhat frequently at one of a small handful of local coffee shops sitting there reading older issues of <a href="http://www.netmag.co.uk/" >.Net Magazine</a> or <a href="http://www.webdesignermag.co.uk/">Web Designer Mag</a> while sipping on a large round of roasted coffee. Why are all the decent web/graphic design magazines from the UK? Come on, I don’t want to have to pay $15 USD because they have to be imported! <img src='http://michaelbox.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<h3>Are there any go-to bands or artists you rely on for a long day and/or night of working, coding, or designing?</h3>

<p><span class="interviewee">Michael</span>: I don’t know if I really have any bands that I constantly rely on, where they’re a shoe-in. I do notice that I go through periods of listening to certain artists regularly or certain styles. The Manic Street Preachers are one of those that I can tend to listen to a lot of for a long while, but then leave alone. Right now, at least when driving somewhere, I’ve been listening to a lot of Sonic Youth. I think I have four of their albums in there right now. All the while, I also tend to have a “hot tracks” tendency. This is where certain tracks, usually from new entries into my personal library, get listened to frequently. The latest example would be “It’s Getting Boring By the Sea” by Blood Red Shoes. This is one of the songs from the soundtrack to Scott Pilgrim Vs. The World, and it’s the one that stood out the most to me. It’s been played quite frequently since then. The video is playing as I type this sentence <img src='http://michaelbox.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>

<p>Seeing as I have typed a novel that in no way relates to the actual question, usually whatever is going on in the above novel is what gets listened to during my hard working days and nights of coding/theming. Either that or musical scores to movies!</p>

<h3>Aside from the usual (Gmail, Twitter, etc), what are some of the websites you’re drawn to check on a daily basis?</h3>

<p><span class="interviewee">Michael</span>: In terms of my bookmarks, my own site admin to check on spam comments and empty appropriately, Okcupid in attempts to work on my personal life, as well as a small list of music group forums that I have joined over the years. After that would just be my RSS feeds including various design/developer related blogs, Dlisted for my gossip and celebrity trashing, my favorite web comics, like XKCD and The Brads, and Digg/Reddit category feeds. Too many get checked too frequently.</p>

<h3>If you could create an unique HTML tag, what would you call it and what should it accomplish?</h3>

<p><span class="interviewee">Michael</span>: The self closing Michael tag. Insert it anywhere with &lt;michael&gt; and have it return my name as a link to my website. Sure it can be done as a WordPress shortcode, but that’s not universal to HTML! Pure narcissism baby!</p>

<h3>From who and where do you tend to get most of your inspiration?</h3>

<p><span class="interviewee">Michael</span>: For a who, I’m going to go ahead and list <a href="http://twitter.com/chriscoyier" title="chriscoyier's Twitter profile">chriscoyier (Twitter)</a> as I have subscribed to his blog and am consistently blown away by his sheer knowledge and creativity in both CSS as well as WordPress methods and ideas. I wish I could have as much output as he does.</p>

<p>For a more generalized answer, any person who thinks outside the circle or any result of an idea that comes from left field. I am always trying to come at things from new angles to see the results. While I don’t always succeed with this(there are only so many angles), I do my best and am inspired by those who do succeed.</p>

<h3>If you could animate your dreams, would they be PG or R rated?</h3>

<p><span class="interviewee">Michael</span>: Tragically I do not remember my dreams 97% of the time, and I really find that to be a shame. If you know me well or have talked with me on a personal level, you know I have a healthy and sometimes rather offbeat personality. I imagine my dreams would be my awake personality multiplied and it would be awesome to be able to remember and write down the best ideas for future use. That said, I imagine the dreams would be at LEAST PG-13 or worse.</p>

<h3>What is your favorite part of the interview process?</h3>

<p><span class="interviewee">Michael</span>: While I probably answered this in my post about how I go about conducting each one, I’ll reiterate what comes to mind as my single favorite part. Reading the answers for the very first time and getting a sense of how much fun the interviewee had with the questions I came up with. This round I got put in the hot seat so this is pretty fun too.</p>

<h3>Sum up your life story in 140 characters</h3>

<p><span class="interviewee">Michael</span>: I was born, I’ll die. What I do with the unknown amount of time in between is up to me. You’re all welcome to tag along as long as you want!</p>

<h3>Bonus: What got you started in web design/development?</h3>
<p><span class="interviewee">Michael</span>: Angelfire and too much time on computers in the ancient days of 1998/1999. It stuck and I went with a career path.</p>]]></content:encoded>
			<wfw:commentRss>http://michaelbox.net/2010/08/18/everyone-elses-interview-with-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>﻿My Time, So Far, as a Minion…or What It’s Like To Work For An Over-hyper Elf</title>
		<link>http://michaelbox.net/2010/03/06/time-so-far-as-a-minion/</link>
		<comments>http://michaelbox.net/2010/03/06/time-so-far-as-a-minion/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 00:51:41 +0000</pubDate>
		<dc:creator>tw2113</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Web Design-Development]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://michaelbox.net/?p=68</guid>
		<description><![CDATA[  Ladies and Gentlemen, My name is Michael Beckwith, and I am a self-confessed minion. I am at Rachael’s command. When she tells me to go make a site update, I go do it. When she tells me to go convert a newly arrived web design into a theme for your new favorite blog, I [...]]]></description>
			<content:encoded><![CDATA[<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: '﻿My Time, So Far, as a Minion…or What It’s Like To Work For An Over-hyper Elf on Michaelbox',url: 'http://michaelbox.net/2010/03/06/time-so-far-as-a-minion/',contentID: 'post-68',suggestTags: 'awesome,web development,wordpress',providerName: 'Michaelbox',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear"> </div>
</div>	<p>Ladies and Gentlemen, My name is Michael Beckwith, and I am a self-confessed minion. I am at <a href="http://thecaffeinateddesignstudio.com/" alt="Caffeinated Design Studio">Rachael’s</a> command. When she tells me to go make a site update, I go do it. When she tells me to go convert a newly arrived web design into a theme for your new favorite blog, I go do it. When it comes to her bidding, I’m on it. Such is the life of a caffeinated minion, and you know what? I would not have it any other way.<p>
<span id="more-68"></span>
	<h3>The Meeting</h3>
        <p>Perhaps I should tell you how I got to this minion state. Let me take you back to the start of Rachael’s and my acquaintanceship. I was at a point in my life where I was just starting with twitter and microblogging in general, and was following anyone who seemed interesting. Rachael was one of those people. I am also a self-confessed coffee junky so when “caffeinatedelf” showed up on my screen, my ears perked. At some point I read a post on her blog about a financially tight time for her and her awesome husband <a href="http://acklincrafts.com/" "alt="Acklin Crafts">Troy</a>. My little heart percolated with intrigue and kindness, and I contacted Rachael about donating $5 of my hard earned money to help two people who I didn't know at all. I reasoned that $5 is not a lot and is equivalent to giving up a large mocha from Starbucks or any higher end coffee location. I could live with parting with one beverage worth. Needless to say, Rachael was extremely touched by the gesture.</p>

	<h3>The Hiring</h3>

	<p>During the course of our friendship;, another idea started percolating. I attended college for five years studying graphic design and multimedia/web development, but have yet to really find my footing afterwards. I knew I needed a way to stay in the game while working a general 40hr/wk job. I was not, and still not, completely confident in myself yet to go full time freelance but if I could pick up some work from time to time, that would be wonderful. I knew that Rachael was running Caffeinated Design Studio so I offered my knowledge and skills. I reasoned that if some of the work load was off her chest, together we could get work done faster and have more time for new work. I felt confident in her company and wanted to help make Caffeinated Design grow.</p>

	<h3>The Work</h3>

	<p>My first minion assignment didn't arrive right away but got to get my hands dirty soon enough. Rachael proceeded to introduce me to a client named <a href="http://notdeadyetstudios.com/" alt="Amy Crook">Amy Crook</a>. She had herself <a href="http://antemortemarts.com/" alt="Antemortem Arts">Antemortem Arts</a> that she uses to promote her paintings and traditional arts. The website was going to use <a href="http://www.wordpress.org/ alt="Wordpress">WordPress</a> as its CMS and Amy had a theme design ready, being a designer herself. This was my first assignment. I had a good fun time making the theme work and provide an awesome website theme.</p>

	<p>Minion assignment number two was very much like the first one but with an added layer of work. Once again I was working with Amy but this time she had a separate client who also needed a wordpress theme implemented. This time I was sent the design’s .psd file and I had to export the elements myself. The rest of the theming process was like the first assignment and in the end, another lovely website was given to the world.</p>

	<h3>The Payoff</h3>

	<p>Through these two assignments, I have helped provide some wonderful looking websites for people using the ever-awesome blogging/cms platform WordPress. I am confident enough to say that everyone involved is more than happy with the final results and the internet is that much of a better place.</p>

	<p>There is no telling what the future holds for me and my minion status with Rachael. I know that I have really enjoyed the work provided to me so far, and hope that Rachael will let me continue along the same vein. I have heard some rumblings that I may be given some practice runs at creating designs myself to see how well I do there. I know that that half has never been my forte because I think I may be better suited on the developer side working with the code and markup. The design experience would be positive and would definitely help refine my rough edges, allowing me to be a bigger asset to both Rachael and anyone I work with in the future. Now if you excuse me, I think I hear an overhyper elfling calling my name.</p>]]></content:encoded>
			<wfw:commentRss>http://michaelbox.net/2010/03/06/time-so-far-as-a-minion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

