<?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>Tristan Bettany - Portfolio</title>
	<atom:link href="http://www.tristanbettany.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tristanbettany.co.uk</link>
	<description>Web Development In Rugby</description>
	<lastBuildDate>Tue, 14 Feb 2012 10:18:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>My first Arduino Circuit</title>
		<link>http://www.tristanbettany.co.uk/2012/02/14/my-first-arduino-circuit/</link>
		<comments>http://www.tristanbettany.co.uk/2012/02/14/my-first-arduino-circuit/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 10:08:14 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Generic]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino UNO]]></category>
		<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[LEDs]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=188</guid>
		<description><![CDATA[Recently I have been planning a project to build a ambilight clone using an Arduino. I havent done any circuit building before or played with an Arduino but I have done an extensive amount of research while planning the development of the amilight clone. This week I ordered a Arduino UNO starter kit to have [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been planning a project to build a ambilight clone using an Arduino. I havent done any circuit building before or played with an Arduino but I have done an extensive amount of research while planning the development of the amilight clone. This week I ordered a Arduino UNO starter kit to have my first go at a basic circuit.  <span id="more-188"></span></p>
<p>I decided I wanted a few LEDS to light up based on information I sent to the serial port with the Arduino linked up to. I wont go into a full tutorial right now, at some point I will come up with a fairly easy and simple tutorial for a beginners first Arduino circuit and post it here.</p>
<p>For the mo below is a video of my circuit in action. It works by the Arduino reading the data sent to the serial port from the MAC which can be any random long string of numbers between 0-2 as there is only 3 LEDS (e.g. 01212101010201212020). 0 is the Red LED, 1 is the Yellow LED and 2 is the Green LED and it will light up the LEDS relative to the numbers in the sequence received.</p>
<!-- Begin - Secure HTML5 Video Player -->
<div class='video-js-box vim-css'>
<video class='video-js' width='550' height='360'  controls="controls" preload="auto"   >
<source src="http://www.tristanbettany.co.uk/wp-content/uploads/my-first-circuit.m4v" type="video/mp4" />
<!-- file not found: /mounted-storage/home2/sub004/sc19229-CNFZ/tristanbettany.co.uk/videos/ -->
</video>
<p class='vjs-no-video'><strong>Download Video:</strong>
<a href="http://www.tristanbettany.co.uk/wp-content/uploads/my-first-circuit.m4v">MP4</a>
</p>
</div>
<!-- End - Secure HTML5 Video Player -->

<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2012/02/14/my-first-arduino-circuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.tristanbettany.co.uk/wp-content/uploads/my-first-circuit.m4v" length="2193330" type="video/mp4" />
		</item>
		<item>
		<title>How to detect Apple mobile devices orientation in CSS</title>
		<link>http://www.tristanbettany.co.uk/2012/01/26/how-to-detect-apple-mobile-devices-orientation-in-css/</link>
		<comments>http://www.tristanbettany.co.uk/2012/01/26/how-to-detect-apple-mobile-devices-orientation-in-css/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 21:57:01 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iDevice]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[Landscape]]></category>
		<category><![CDATA[Orientation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portrait]]></category>
		<category><![CDATA[xHTML]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=180</guid>
		<description><![CDATA[This week I was inspired to work out how to change a CSS stylesheet and overall layout based on a mobile devices orientation. This would allow for much more user friendly webpage viewing in both landscape and portrait modes of tablets and phones. So far I can only tell that this orientation setting in CSS3 [...]]]></description>
			<content:encoded><![CDATA[<p>This week I was inspired to work out how to change a CSS stylesheet and overall layout based on a mobile devices orientation. This would allow for much more user friendly webpage viewing in both landscape and portrait modes of tablets and phones.  <span id="more-180"></span></p>
<p>So far I can only tell that this orientation setting in CSS3 works on mobile safari as people tell me im a bit of a apple-fag these days. Anyway, the script I made comes down to the meta tags in the header which are used to swap out css files according to the orientation of the device, after detecting which device your using with PHP. Heres an example of the meta tags using the orientation setting:</p>
<pre>&lt;link rel="stylesheet" type="text/css" media="screen and (orientation:portrait)" href="style/iPad/iPadPortrait.css" /&gt;
&lt;link rel="stylesheet" type="text/css" media="screen and (orientation:landscape)" href="style/iPad/iPadLandscape.css" /&gt;</pre>
<p>Ive put up a live example <a target="_blank" href="http://www.tristanbettany.co.uk/rotate">here</a> for you to test it out yourself before implementing it into your own code.</p>
<p>To checkout all the code including the PHP used to run the live example please download the zipped code <a href="http://www.tristanbettany.co.uk/downloads/iDevice-Orientation-Detection.zip">here</a>. Any questions about the code please leave them in the comments.</p>
<p>I developed this code after being inspired by a blog post I saw on a friends blog about <a target="_blank" href="http://www.imafish.co.uk/blog/22-01-12/responsive-web-design">Responsive Design</a> at ImAFish.co.uk. After e-mailing him my code he followed up with a <a target="_blank" href="http://www.imafish.co.uk/blog/26-01-12/apple-device-orientation">blog post about my code</a>, so a thanks is in order there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2012/01/26/how-to-detect-apple-mobile-devices-orientation-in-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tristan Bettany goes on the search for a new Job</title>
		<link>http://www.tristanbettany.co.uk/2011/10/24/tristan-bettany-goes-on-the-search-for-a-new-job/</link>
		<comments>http://www.tristanbettany.co.uk/2011/10/24/tristan-bettany-goes-on-the-search-for-a-new-job/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 02:34:25 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Generic]]></category>
		<category><![CDATA[Curriculum Vitae]]></category>
		<category><![CDATA[CV]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Tristan Bettany]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=156</guid>
		<description><![CDATA[Right now I&#8217;m looking for a new job as I want to progress to better things. Currently I work nights at a hotel and use really dead nights and my spare time to work on web design projects. I&#8217;m now looking to do this full time so read on to learn how I began to [...]]]></description>
			<content:encoded><![CDATA[<p>Right now I&#8217;m looking for a new job as I want to progress to better things. Currently I work nights at a hotel and use really dead nights and my spare time to work on web design projects. I&#8217;m now looking to do this full time so read on to learn how I began to approach this. <span id="more-156"></span></p>
<p>First of all I decided I needed a <a target="_blank" href="http://www.tristanbettany.co.uk/cv">seriously eye catching CV</a> that stood out from the crowd. To stand out from the crowd I was going to have to do something much more than your average word document. I thought that treating the CV as a piece of artwork instead would give it that zing it needed to catch someones attention.</p>
<p>I created my eye catching CV in Adobe Fireworks which is great for designing creative typography style graphics. As I was under away making my CV I was presented with the task of creating a winning Summary. I did really want to write that &#8220;I am just super awsume fantastico&#8221; but decided to go with a more professional approach.</p>
<p>Now my CV has the vibrancy of colour and the zing of tasteful design and layout it should stand out well in the thousands of CV&#8217;s that usually end up on an employers desk. Also to add an extra element to the CV I made a lovely version of it online which is nicely animated using my JavaScript skills. You can find it <a target="_blank" href="http://www.tristanbettany.co.uk/cv">here</a>.</p>
<p>Anyway, check out my CV online if your a reputable employer or if you have already had me in for an interview then thank you very much and enjoy the online version of my CV.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/10/24/tristan-bettany-goes-on-the-search-for-a-new-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New FanPics.tv WebSite Released</title>
		<link>http://www.tristanbettany.co.uk/2011/08/24/new-fanpics-tv-website-released/</link>
		<comments>http://www.tristanbettany.co.uk/2011/08/24/new-fanpics-tv-website-released/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 20:23:41 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[Banners]]></category>
		<category><![CDATA[ClearArt]]></category>
		<category><![CDATA[ClearLogos]]></category>
		<category><![CDATA[FanArt]]></category>
		<category><![CDATA[FanPics.tv]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Landscape]]></category>
		<category><![CDATA[Logos]]></category>
		<category><![CDATA[Plex]]></category>
		<category><![CDATA[Posters]]></category>
		<category><![CDATA[TV Shows]]></category>
		<category><![CDATA[XBMC]]></category>
		<category><![CDATA[XBOX Media Centre]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=163</guid>
		<description><![CDATA[Recently I have been working on a new idea for a search engine to scrape artwork for TV shows from multiple sources into one easy to find place. Within a week I had came up with FanPics.tv and coded a fully functioning TvShow FanArt Search Engine. This is a recent project which I have spent [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been working on a new idea for a search engine to scrape artwork for TV shows from multiple sources into one easy to find place. Within a week I had came up with FanPics.tv and coded a fully functioning TvShow FanArt Search Engine. <span id="more-163"></span></p>
<p style="text-align:center;"><a href="http://fanpics.tv"><img src="http://www.tristanbettany.co.uk/wp-content/uploads/fanpics-1024x437.jpg" alt="" title="fanpics" width="500px" /></a></p>
<p>This is a recent project which I have spent most time thinking about and planning up until the frantic week long coding session to get it out there. The idea behind it is to allow users to obtain artwork for TV Shows they own within media centre software such as XBMC (Xbox media centre). The XBMC Media centre software allows you to set artwork manually for each show such as banners, logos and fanart but can be a rather tedious task to trawl multiple popular websites looking for the art you want. FanPics.tv to the rescue!. It scrapes artwork from multiple popular fanart databases and displays them in one easy to see place ready for you to browse and download as you see fit.</p>
<p>For the inner nerd keep reading for more technical information about the website&#8230; This websites interface and main workings have been built with a firm solid structure of jQuery and AJAX interfacing with a PHP backend. It does quite alot of work behind the scenes with searching for your requested show and pulling artwork from multiple different Public databases. All of this is done to make your life easier when looking for artwork and give you the option to get it all from one website in a few clicks.</p>
<p>Save your time searching for artwork and visit <a target="_blank" href="http://fanpics.tv">FanPics.tv now</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/08/24/new-fanpics-tv-website-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript/jQuery Fancy Front Page Scroller</title>
		<link>http://www.tristanbettany.co.uk/2011/06/29/javascriptjquery-fancy-front-page-scroller/</link>
		<comments>http://www.tristanbettany.co.uk/2011/06/29/javascriptjquery-fancy-front-page-scroller/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 05:10:37 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS jQuery]]></category>
		<category><![CDATA[Front Page Scrolling]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Scrolling Web Page]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=126</guid>
		<description><![CDATA[This is a project I did over a weekend for my own fancy little front page scroller we always see on websites these days designed for advertising their latest products or blog posts. I would say that 50% of these are all still made in flash. Flash is slow, buggy and incompatible with alot of [...]]]></description>
			<content:encoded><![CDATA[<p>This is a project I did over a weekend for my own fancy little front page scroller we always see on websites these days designed for advertising their latest products or blog posts. I would say that 50% of these are all still made in flash. Flash is slow, buggy and incompatible with alot of things and esspecialy wont work on a tablet. So I decided to make my own very compatible scroller for use on any new sites I make. <span id="more-126"></span></p>
<p><img style="text-align: center; border: 0px;" width="550px" height="294px" src="http://www.tristanbettany.co.uk/wp-content/uploads/fancy_scroller.jpg" alt="jsScroller" /></p>
<p>The entirety of this project is made in pure CSS and JavaScript/jQuery as coding with those languages is the easiest way to maintain compatibility across browsers. So I needed a way to scroll and animate between DIV layers in JavaScript at which point I found the custom jQuery function (.scrollTo) written by <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" target="_blank">Ariel Flesler</a>.</p>
<p>Using a heafty amount of my own nifty JavaScript and beatifull CSS skills I utalised this handy function to make my lovely scroller you see in the screenshot above. To try it out for yourself then click <a href="http://www.tristanbettany.co.uk/projects/jsScroller/" target="_blank">here</a></p>
<p>The features of my scroller are listed below</p>
<ul>
<li>Auto Scrolling</li>
<li>Pause/Un-Pause Auto Scrolling</li>
<li>Navigation Dots for Manual Scrolling</li>
<li>Current Pane On View Showed with Color change of Navigation Dots</li>
<li>MouseOver triggers current panes Label Animation</li>
<li>Compatability with Mobile Devices/Tablets &#038; Internet Explorer (IE7 >)</li>
<li>Completely CSS and JavaScript/jQuery Only</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/06/29/javascriptjquery-fancy-front-page-scroller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New PixelGrafters WebSite Finished</title>
		<link>http://www.tristanbettany.co.uk/2011/05/07/new-pixelgrafters-website-finished/</link>
		<comments>http://www.tristanbettany.co.uk/2011/05/07/new-pixelgrafters-website-finished/#comments</comments>
		<pubDate>Sat, 07 May 2011 04:08:30 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[12Sticks]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[FaceBook]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PixelGrafters]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[We Love It]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=109</guid>
		<description><![CDATA[Ive been busy recently and not posted in a while. What have I been up to exactly? Ive been coding the new version of PixelGrafters and its now finished. Ive also been playing with ways of getting myself known better on the internet. I got PixelGrafters on Twitter and FaceBook, Ive started a new AdWords [...]]]></description>
			<content:encoded><![CDATA[<p>Ive been busy recently and not posted in a while. What have I been up to exactly? Ive been coding the new version of PixelGrafters and its now finished. Ive also been playing with ways of getting myself known better on the internet. I got PixelGrafters on Twitter and FaceBook, Ive started a new AdWords campaign, installed AdSense on my websites, plus ive been setting up Windows server 2008 on my server at home but that&#8217;s another story and a dull one at that. <span id="more-109"></span></p>
<div style="text-align:center;">
<p style="display:inline-block;text-align:center;"><a target="_blank" href="http://www.tristanbettany.co.uk/wp-content/uploads/PG_front.jpg"><img width="250px" style="border:0;" src="http://www.tristanbettany.co.uk/wp-content/uploads/PG_front.jpg" alt="PixelGrafters Home Page" /></a><br/><strong> ^ PixelGrafters Home Page ^ </strong></p>
<p style="display:inline-block;text-align:center;"><a target="_blank" href="http://www.tristanbettany.co.uk/wp-content/uploads/PG_movie.jpg"><img width="250px" style="border:0;" src="http://www.tristanbettany.co.uk/wp-content/uploads/PG_movie.jpg" alt="PixelGrafters Movie Page" /></a><br/><strong> ^ PixelGrafters Movie Page ^ </strong></p>
</div>
<p>Above is a couple of pictures of the new site. Now when you fancy a wallpaper of a movie that has just come out or any movie for that matter, simply head on over to <a target="_blank" href="http://www.pixelgrafters.co.uk">PixelGrafters</a> and you should be able to find it with all its artwork for you to play with.</p>
<p>I did something rather clever with PixelGrafters to make it faster. The processing of the front page latest released movie results is processed by my home servers as a automated task and saved to a file which is automatically loaded remotely from the webpage. This means the content is always up to date without having to slow your experience down by getting the results live.</p>
<p>Ive also taken the time to get PixelGrafters its own page on facebook <a target="_blank" href="https://www.facebook.com/pages/PixelGrafters/152456624819641">here</a>. Its also on twitter <a target="_blank" href="https://twitter.com/#!/PixelGrafters">here</a>.</p>
<p>Whats left to do with PixelGrafters? There&#8217;s a few little fine tweaks needed and ironing out to fully make sure users don&#8217;t experience random errors. Im also thinking of adding trailers embedded into the page and I want to get proper integration of social networks.</p>
<p>Recently I have also taken the opportunity to start writing the odd post for a website called <a target="_blank" href="http://12stix.com/">12stix</a>. They provide the web with quick easy and to the point fixes of general techno annoyances and issues. Take a look at the linked website and the pages and then maybe For fun you can also send me some love if you like for PixelGrafters via <a target="_blank" href="http://www.we-loveit.com/PixelGrafters">www.we-loveit.com/PixelGrafters</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/05/07/new-pixelgrafters-website-finished/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linking 2 APIs [RottenTomatoes &amp; TheMovieDB]</title>
		<link>http://www.tristanbettany.co.uk/2011/04/18/linking-2-apis-rottentomatoes-themoviedb/</link>
		<comments>http://www.tristanbettany.co.uk/2011/04/18/linking-2-apis-rottentomatoes-themoviedb/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 13:50:14 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PixelGrafters]]></category>
		<category><![CDATA[RottenTomatoes]]></category>
		<category><![CDATA[TheMovieDB]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=103</guid>
		<description><![CDATA[As you know I am currently working on re-developing PixelGrafters. A friend of mine introduced me to a new API from Rotten Tomatoes, I was interested as what new information this could provide me with as I currently use TheMovieDB. It turned out the Information about the movies really excelled in lists of movies such [...]]]></description>
			<content:encoded><![CDATA[<p>As you know I am currently working on re-developing PixelGrafters. A friend of mine introduced me to a new API from Rotten Tomatoes, I was interested as what new information this could provide me with as I currently use TheMovieDB. It turned out the Information about the movies really excelled in lists of movies such as &#8220;Upcoming&#8221;  , &#8220;In Theatres&#8221;, &#8220;Movies Opening This week&#8221;, &#8220;DVD Releases this week&#8221;. This Info could be incredibly useful for me. <span id="more-103"></span></p>
<p>Unfortunately The images provided by <a target="_blank" href="http://www.rottentomatoes.com">Rotten Tomatoes</a> are kind of pathetic. So I want to keep getting the images from <a target="_blank" href="http://www.themoviedb.org/">TheMovieDB</a> but grab lists of these movies from Rotten Tomatoes. This is easier said than done. To accurately reference a movie on TheMovieDB a &#8220;IMDB-ID&#8221; is required which is not given out by Rotten Tomatoes which is a shame. I came up with a solution which will be on the most part completely accurate, I haven&#8217;t found it fail yet or pick up the wrong movie.</p>
<p>What I did was found a way to search TheMovieDB by the exact movie title pulled from Rotten Tomatoes and constrain the search by the year the movie was released also pulled from Rotten Tomatoes. I didn&#8217;t think it would be accurate enough at first but it certainly seems to do the trick. This now allows me to view the list of Movies I wanted with much better quality artwork. Im going to wack into the post the code below.</p>
<p>Bear in mind the PHP snippet below is just the code to display movies in a way I wanted which is combined from 2 of Rotten Tomatoes Lists from the API and then using PHP to filter out the movies not released this year allowing to display just the most popular movies being released in your local multiplex. Also I haven&#8217;t commented it yet as its still subject to change due to PixelGrafters being in development right now.</p>
<p>Please feel free to use this code and please credit me if you do. Thanks</p>
<pre>//Code By Tristan Bettany - TristanBettany.co.uk
//Script Designed For PixelGrafters.co.uk
//Please Credit Me if used - Thanks
&lt;?PHP
	$date = date('d-m-Y');
	$split = explode("-", $date);
	$year = $split[2];

	$TMDB_APIKey = "Your TheMovieDB API Key";
	$RT_APIKey = "Your Rotten Tomatoes API Key";

	$RT_NewReleases = 'http://api.rottentomatoes.com/api/public/v1.0/lists/movies/opening.json?apikey=' . $RT_APIKey . '&amp;country=UK';
	$RT_InTheatres = 'http://api.rottentomatoes.com/api/public/v1.0/lists/movies/in_theaters.json?apikey=' . $RT_APIKey . '&amp;country=UK';

	$session_A = curl_init($RT_NewReleases);
	curl_setopt($session_A, CURLOPT_RETURNTRANSFER, true);
	$return_A = curl_exec($session_A);
	curl_close($session_A);
	$NewReleases = json_decode($return_A);
	if ($NewReleases === NULL) die('Error parsing json');
	$movies_A = $NewReleases-&gt;movies;

	$session_B = curl_init($RT_InTheatres);
	curl_setopt($session_B, CURLOPT_RETURNTRANSFER, true);
	$return_B = curl_exec($session_B);
	curl_close($session_B);
	$InTheatres = json_decode($return_B);
	if ($InTheatres === NULL) die('Error parsing json');
	$movies_B = $InTheatres-&gt;movies;

	foreach ($movies_A as $NewRelease) {
	$TMDB_Echoed = false;
		if ($NewRelease-&gt;year == $year) {
			if ($NewRelease-&gt;posters-&gt;detailed != "http://images.rottentomatoescdn.com/images/redesign/poster_default.gif") {

				$title = urlencode($NewRelease-&gt;title);
				$TMDB_URL = 'http://api.themoviedb.org/2.1/Movie.browse/en/xml/'. $TMDB_APIKey .'?order_by=release&amp;order=desc&amp;per_page=10&amp;page=1&amp;query=' . $title .'&amp;year=' . $NewRelease-&gt;year;
				if(!$xml = simplexml_load_file($TMDB_URL)) exit('Failed to open '.$TMDB_URL);
				$movieCount=0;
				foreach($xml-&gt;movies-&gt;movie as $movie) {
					if ($movieCount == 1){
						break;
					}
					$imdb_id = $movie-&gt;imdb_id;
					$imageCount=0;
					if ($imdb_id != "") {
						foreach($xml-&gt;movies-&gt;movie[$movieCount]-&gt;images-&gt;image as $image) {
							if ($image['type'] == 'poster') {
								if ($image['size'] == 'original') {
									$hiRes_Link[$movieCount] = $image['url'];
								}
								if ($image['size'] == 'cover') {
									$medRes_Link[$movieCount] = $image['url'];
								}
							}
							$imageCount++;
						}
						if (isset($medRes_Link[0])) {
							echo '&lt;a target="_blank" href="' . $hiRes_Link[0] . '"&gt;';
							echo '&lt;img width="185" height="278" src="' . $medRes_Link[0] . '" &gt;&lt;/img&gt;&lt;/a&gt;';
							$TMDB_Echoed = true;
							ob_flush();
							flush();
						}
					}
				$movieCount++;
				}

				if(!$TMDB_Echoed){
					echo '&lt;a href="' . $NewRelease-&gt;links-&gt;alternate . '"&gt;';
					echo '&lt;img width="185" height="278" src="' . $NewRelease-&gt;posters-&gt;detailed . '"&gt;&lt;/img&gt;&lt;/a&gt;';
					ob_flush();
					flush();
				}
			}
		}
	}

	foreach ($movies_B as $InTheatre) {
	$TMDB_Echoed = false;
		if ($InTheatre-&gt;year == $year) {
			if ($InTheatre-&gt;posters-&gt;detailed != "http://images.rottentomatoescdn.com/images/redesign/poster_default.gif") {

				$title = urlencode($InTheatre-&gt;title);
				$TMDB_URL = 'http://api.themoviedb.org/2.1/Movie.browse/en/xml/'. $TMDB_APIKey .'?order_by=release&amp;order=desc&amp;per_page=10&amp;page=1&amp;query=' . $title .'&amp;year=' . $InTheatre-&gt;year;
				if(!$xml = simplexml_load_file($TMDB_URL)) exit('Failed to open '.$TMDB_URL);
				$movieCount=0;
				foreach($xml-&gt;movies-&gt;movie as $movie) {
					if ($movieCount == 1){
						break;
					}
					$imdb_id = $movie-&gt;imdb_id;
					$imageCount=0;
					if ($imdb_id != "") {
						foreach($xml-&gt;movies-&gt;movie[$movieCount]-&gt;images-&gt;image as $image) {
							if ($image['type'] == 'poster') {
								if ($image['size'] == 'original') {
									$hiRes_Link[$movieCount] = $image['url'];
								}
								if ($image['size'] == 'cover') {
									$medRes_Link[$movieCount] = $image['url'];
								}
							}
							$imageCount++;
						}
						if (isset($medRes_Link[0])) {
							echo '&lt;a target="_blank" href="' . $hiRes_Link[0] . '"&gt;';
							echo '&lt;img width="185" height="278" src="' . $medRes_Link[0] . '" &gt;&lt;/img&gt;&lt;/a&gt;';
							$TMDB_Echoed = true;
							ob_flush();
							flush();
						}
					}
				$movieCount++;
				}

				if(!$TMDB_Echoed){
					echo '&lt;a href="' . $InTheatre-&gt;links-&gt;alternate . '"&gt;';
					echo '&lt;img width="185" height="278" src="' . $InTheatre-&gt;posters-&gt;detailed . '"&gt;&lt;/img&gt;&lt;/a&gt;';
					ob_flush();
					flush();
				}
			}
		}
	}
	echo '&lt;/ul&gt;

';
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/04/18/linking-2-apis-rottentomatoes-themoviedb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Custom Made BOT Protection System for PixelGrafters</title>
		<link>http://www.tristanbettany.co.uk/2011/04/13/new-custom-made-bot-protection-system-for-pixelgrafters/</link>
		<comments>http://www.tristanbettany.co.uk/2011/04/13/new-custom-made-bot-protection-system-for-pixelgrafters/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 01:46:04 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Anti-Spam]]></category>
		<category><![CDATA[Bot Protection]]></category>
		<category><![CDATA[Bots]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PixelGrafters]]></category>
		<category><![CDATA[Server Managment]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=91</guid>
		<description><![CDATA[Over the weekend I have been coding a new BOT protection system for the new version of PixelGrafters. Over many years now PixelGrafters has frequently been bombarded by bots due to the nature of the dynamic content I display and it annoys me that I cannot tell very easily what is a human visitor. I [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I have been coding a new BOT protection system for the new version of PixelGrafters. Over many years now PixelGrafters has frequently been bombarded by bots due to the nature of the dynamic content I display and it annoys me that I cannot tell very easily what is a human visitor. I decided I wanted that to change so I got coding, here is some details on what I came up with over the past 3 days.   <span id="more-91"></span></p>
<p style="text-align:center;"><img width="550px" style="border:0;" src="http://www.tristanbettany.co.uk/wp-content/uploads/bot_protection.jpg" alt="PixelGrafters Admin Panel" /><br/><strong> ^ PixelGrafters Admin Panel ^ </strong></p>
<p>The idea was simple, ban nasty bots and send them 403 errors and allow good ones to crawl as normal. I started off with a little re-search on the practises of bad bots. It turns out that mostly a bad bot will do spoofing of useragents so you cant block them that way through the robots.txt and do the opposite of the rules you lay down in the robots.txt file most of the time. This made me think I could trap them with some &#8220;honey traps&#8221;.</p>
<p>The first idea was to deny access to a directory in robots.txt and then when the bot visits that directory they get banned. To ban them I needed to store all data about them so with some nifty PHP I logged all possible info the server could give me and did a reverse DNS lookup on them which is only 1 single function in PHP (nice!). After storing that data if they come back with the same IP address they will still be banned and sent a 403 error.</p>
<p>This is IP address specific and if they come back with a different IP address they will be allowed but if they act in the same way eventually they will be banned again and the owners of the BOT should eventually run out of IP addresses to use I imagine.</p>
<p>I also wanted to create a Admin Panel for any BOT that wasn&#8217;t automatically caught by a honey trap. This would allow me to ban manually. This prompted a re-structuring of the database and system I started with to contain 4 tables. One for nice bots (google etc), one for banned bad bots, one for locations IP address had been to, and one for unassigned visits.</p>
<p>This was massive and took a long time and quite a bit of debugging to make it work how I wanted. but now I can log all locations of where a visitor has been and I can move them to other tables assigning them as either a banned bot, or nice bot and drop all the info about their visits from the system altogether. </p>
<p>As far as I can tell now this is flawless, I still need to add in a few more honey traps as nasty bots are intentionally looking for files on the server such as &#8220;/wp-login.php&#8221; so they can attempt to hack peoples wordpress accounts. This will simply be a regular expression that checks for similarity to certain patters in the URL and if they are obviously looking for stuff they shouldn&#8217;t be they will be banned, haha.</p>
<p>As far as looks goes with the Admin Panel, I made it look all pretty with my usual CSS skills. I made each visit log in what looks like a table but is actually an un-ordered list. Then each list item has a drop down which I made with MooTools jQuery API so you can see more info such as locations the visitor has been to when expanded. Then theres the links on the right for managing bans and deleting data etc. The Image at the Top of the Post is the Admin Panel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/04/13/new-custom-made-bot-protection-system-for-pixelgrafters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Returning Search Results from TheMovieDB &amp; Optimizing PixelGrafters</title>
		<link>http://www.tristanbettany.co.uk/2011/04/09/returning-search-results-from-themoviedb-and-optimizing-pixelgrafters/</link>
		<comments>http://www.tristanbettany.co.uk/2011/04/09/returning-search-results-from-themoviedb-and-optimizing-pixelgrafters/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 03:27:48 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PixelGrafters]]></category>
		<category><![CDATA[Searching]]></category>
		<category><![CDATA[SimpleXML]]></category>
		<category><![CDATA[The Movie DataBase]]></category>
		<category><![CDATA[TheMovieDB]]></category>
		<category><![CDATA[Thumbnails]]></category>
		<category><![CDATA[TMDB]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=47</guid>
		<description><![CDATA[PixelGrafters is currently under going massive optimization and development and I will be releasing version 3.0 hopefully with a mobile version of the site. Although that may be released as an extra feature in version 3.5. Im going to show you a snippet here of how im optimising the code for grabbing search results from [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.pixelgrafters.co.uk">PixelGrafters</a> is currently under going massive optimization and development and I will be releasing version 3.0 hopefully with a mobile version of the site. Although that may be released as an extra feature in version 3.5. Im going to show you a snippet here of how im optimising the code for grabbing search results from <a target="_blank" href="http://www.themoviedb.org">themoviedb.org</a><span id="more-47"></span> </p>
<p>Previously PixelGrafters was using the PHP cURL() function to return search results from themoviedb.org in XML and then provide the massive amount of filtering needed to get rid of the junk submitted to its open and free to use database. The filtering is necessary to provide the user a much more user friendly view of information about a requested movie. Also it acts similar to basic AI allowing PixelGrafters to auto select a movie for you based on your search terms. </p>
<p>Now though I have improved the method for returning results making <a target="_blank" href="http://www.pixelgrafters.co.uk">PixelGrafters</a> much faster and it will also make it nicer to browse when the site is finished. It seems before I was taking the long and hard way of doing it when there was a much more simpler option I hadn&#8217;t thought of. Just incase anybody else is wondering how to pull search results from <a target="_blank" href="http://www.themoviedb.org">themoviedb.org</a> fairly simply then heres some PHP code below. Ill explain it first.</p>
<p>Briefly this code is going to give you the thumbnail image for each movie in the search results from <a target="_blank" href="http://www.themoviedb.org">themoviedb.org</a> of a query passed through the url like so&#8230; www.mydomain.com/myquery.</p>
<pre>$URI = $_SERVER["REQUEST_URI"];
$URI_VARS = explode("/", $URI);
$query = $URI_VARS[1];

$APIKey = "Sorry I cant give my API key away";
$file = 'http://api.themoviedb.org/2.1/Movie.search/en/xml/'
	 . $APIKey . '/' . $query;
if(!$xml = simplexml_load_file($file))
{
    exit('Failed to open '.$file);
}

$movieCount=0;
foreach($xml-&gt;movies-&gt;movie as $movie)
{
	$imageCount=0;
	foreach($xml-&gt;movies-&gt;movie[$movieCount]-&gt;images-&gt;image as $image)
	{
		if ($image['size'] == 'cover')
		{
			echo '&lt;img src="';
			echo $image['url'];
			echo '" &gt;&lt;/img&gt;';
			echo '&lt;br/&gt;';
		}
		$imageCount++;
	}
$movieCount++;
}</pre>
<p> In Detail what this does is it will request the URI (the string of data after the .com or .co.uk etc), split it up to get the data after the forward-slash and treat that data as your search query. Then its going to set the remote location to themoviedb.org&#8217;s API with your API key and the query you passed. Then it will load the XML from that location into a simplexml object. Once successfully doing that it will loop through each movie in the search results and then each image in each movie and each time it finds an image of the size &#8220;cover&#8221; in the XML it will echo the image to the page.</p>
<p>I hope thats of any use to anybody trying to code something funky using themoviedb.org&#8217;s API. Enjoy and the new <a target="_blank" href="http://www.pixelgrafters.co.uk">PixelGrafters</a> will be out soon.</p>
<p> <img src='http://www.tristanbettany.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/04/09/returning-search-results-from-themoviedb-and-optimizing-pixelgrafters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Business Cards &#8211; Simple Yet elegant design</title>
		<link>http://www.tristanbettany.co.uk/2011/03/15/new-business-cards-simple-yet-elegant-design/</link>
		<comments>http://www.tristanbettany.co.uk/2011/03/15/new-business-cards-simple-yet-elegant-design/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 02:53:56 +0000</pubDate>
		<dc:creator>Tristan-Bettany</dc:creator>
				<category><![CDATA[Generic]]></category>
		<category><![CDATA[Business Card]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.tristanbettany.co.uk/?p=43</guid>
		<description><![CDATA[Ive spent the past few days tinkering with a few ideas and designs for a new Business Card and finally come up with a design I like. I designed it in photoshop and have put pics of the new design in this post so anyone struggling out there with ideas for their own new card [...]]]></description>
			<content:encoded><![CDATA[<p>Ive spent the past few days tinkering with a few ideas and designs for a new Business Card and finally come up with a design I like. I designed it in photoshop and have put pics of the new design in this post so anyone struggling out there with ideas for their own new card then this may give you a little inspiration. <span id="more-43"></span> </p>
<div style="text-align:center;">
<div style="display: inline-block; margin-right: 10px;">
	<a href="http://www.tristanbettany.co.uk/wp-content/uploads/BC_front.jpg" target="_blank"><img width="250px" title="Business Card - Front" src="http://www.tristanbettany.co.uk/wp-content/uploads/BC_front.jpg" alt="Business Card - Front" /></a>
	</div>
<div style="display: inline-block; margin-right: 10px;">
	<a href="http://www.tristanbettany.co.uk/wp-content/uploads/BC_reverse.jpg" target="_blank"><img width="250px" title="Business Card - Reverse" src="http://www.tristanbettany.co.uk/wp-content/uploads/BC_reverse.jpg" alt="Business Card - Reverse" /></a>
	</div>
</div>
<p>This design works well for me being a web developer as its not too flamboyant, its straight to the point and I made something similar to a tag cloud which you tend to find on blogs to highlight my skills on the left side of the card. I would say its simple, yet elegant. </p>
<p>I designed the card in photoshop I think Ive produced a fairly good result. It should satisfy the visually impaired as well as some people can struggle reading black text on a white background. I myself find it much easier to read the White on black side but that could be just because my computer monitor is an LED screen and is about as bright as looking directly at the sun. </p>
<p>Anyway, I hope my design gives many of you plenty of inspiration. If so then leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tristanbettany.co.uk/2011/03/15/new-business-cards-simple-yet-elegant-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

