<?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; howto</title>
	<atom:link href="http://michaelbox.net/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelbox.net</link>
	<description>A container of ideas, creativity, passions, and adventures</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:15:11 +0000</lastBuildDate>
	<language>en</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 on [...]]]></description>
			<content:encoded><![CDATA[<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>And now you know…my interview process</title>
		<link>http://michaelbox.net/2010/07/13/my-interview-process/</link>
		<comments>http://michaelbox.net/2010/07/13/my-interview-process/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 16:00:44 +0000</pubDate>
		<dc:creator>tw2113</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[interview]]></category>

		<guid isPermaLink="false">http://michaelbox.net/?p=187</guid>
		<description><![CDATA[If you are reading this post, then chances are high that you are well aware of my ongoing interview series “Do You Think You Know…”. If you have managed to beat the odds and do not know what I’m talking about, just read some previous posts, the series will stand out and you can get [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_188" class="wp-caption alignright" style="width: 310px"><img src="http://michaelbox.net/wp-content/images/15sign-300x300.jpg" alt="The number 15" title="15sign" width="300" height="300" class="size-medium wp-image-188" /><p class="wp-caption-text">CC Attribution-ShareAlike 2.0 Generic http://www.flickr.com/photos/lincolnian/</p></div><p>If you are reading this post, then chances are high that you are well aware of my ongoing interview series “Do You Think You Know…”. If you have managed to beat the odds and do not know what I’m talking about, just read some previous posts, the series will stand out and you can get caught up easily.</p><span id="more-187"></span>

<p>At this point in time, I have conducted six interviews, and they all have had varying levels of popularity and high levels of enjoyment for both myself and the person we’re getting to know. Within this post, I hope to explain and describe the general process used going into each interview, even as it is bound to change and evolve with time and experience. I also hope to clarify motives for why I choose to make the effort.</p>

<p>Sadly, I am do not hold an employment position that uses any of my design and development knowledge. Any design or development work has been done during my free time away from a 40hr/week day job. While I won’t comment further on my day job, I will admit that I do still appreciate the amount of time available to think and brainstorm, even if it does suffer distractions. It was during that free time that the first draft of this post was written then on yellow legal paper. This is also when all questions, for the person in the hotseat, are conceived. I am able to sit, figure out what I am going to ask, and how I’m going to word them.</p>

<p>I have done what I can to keep the questions pretty open ended but also keep some topics regular with each interview. Questions involving favorite colors and fonts, preference between pirates and ninjas and the occasional zombie or pirate, and a nonsensical question involving birds on powerlines, have all been used regularly. One that I take a lot of pride in and put a lot of focus on is about twitter users that the interviewee recommends. This focus is because almost all of the people that we’ve gotten to know together, I first met on Twitter. One of the best parts about this question is the allowance granted to the interviewee to highlight some people important to them. Little bits of promotion and recommendation facilitates everyone winning and meeting new people.</p>

<p>At the end of the brainstorming stage, I have fifteen questions that I’ve done my best to tailor fit the person, their personality, and their areas of specialty. The questions are a mix of serious and (hopefully)humorous questions. Before sending the questions, I organize them in a manner that goes back and forth between serious and humorous. I do what I can to accomodate for busy schedules by sending the questions about two weeks before the day I plan to publish the post. I also send friendly reminders, if necessary, a couple times during the two weeks.</p>

<p>Once I receive the answered questions back, I put everything into a new wordpress post, apply the necessary styling, add the associated settings and metadata, and schedule it for the right date and time. The post going live is what I look forward to the most, as it is when myself and the interviewed get to have fun promoting the interview and spreading the love. Reading the twitter replies, retweets, post comments, and anything else make all the time and effort worth it.</p>

<p>At the end of the day, I get to take pride in that I got to promote someone I care about, support, and believe in. Meanwhile, that person gets to be in the spotlight for a day and be the focus of peoples’ attention. I hope that it is considered a huge honor, with them being in a field where so frequently they do the highlighting, primarily for clients. That is why I put forth the effort.</p>]]></content:encoded>
			<wfw:commentRss>http://michaelbox.net/2010/07/13/my-interview-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

