My friend noticed this the other day but I hadn’t realised it was still going on… anyone mind commenting what the hell is going on here?!?!

Facebook time left image

No Need To Register

13th January 2011

You know what I hate? I hate arriving on some obscure little blog and wanting to leave a comment and being told I have to register to do so.

Why the hell should I register, when I’m never going to their site again. You know what? From now on, you can leave a comment, on this here site, without registering, because why the hell should you have to?!

I hate dentists.

5th January 2011

I’m sitting in the waiting room of my dental surgery. When I was a child, I had a dentist who gave me a filling every time I went, drawing me to believe my teeth were rotting.

When I became a teenager something happened in which the local anaesthetic that they inject when they plan to start work stopped working properly. It would give me all the swelling you would expect and it would numb the surface level of my gums but that was it. They would start drilling and I would start yelling. After leaving my childhood dentist, I was told that he was well known in my home town for doing anything to get fee. If the patient or their parents were gullible enough, he would give them treatment they didn’t need just to get paid for it by the NHS. I now live with a mouth fully of painfully made fillings that I’m sure I never needed.

After that, I chose to avoid visiting dentists. I hated them. Unfortunately, last year, one of the probably unneeded fillings near the back of my mouth fell out. Not realising what had happened, I ignored the strange sharpness of one of my teeth for months. The hole in my tooth grew and then the headaches began. They carried on for weeks and I eventually took myself, having no registered dentist, to the Dundee Dental Hospital, after a few hours of waiting to be seen, they deemed the tooth impossible to save and under anaesthetic that barely worked, they pulled it from my mouth in a procedure that took the poor dentals students performing it, 20 minutes to do so, eventually their supervisor took over as the two student had run out of muscle to get the tooth out, it still took him a further 5 minutes of rocking the tooth back and forth to take it out, all while I’m grasping onto the chair in pain.

I’m now here, at the City Quay Dental Clinic, for a check up and I’m really not looking forward to it, I hate dentists.

…..

I had to stop typing there, got called in for my appointment, only 15 minutes late too, that’s a new record, usually it’s well over 20.

Today’s appointment was interesting. All good, nothing wrong, no drilling, no medication, why can’t all appointments be like that. There was one thing though, one thing that’s been consistent at every dentist I’ve been too, so perhaps you can tell me. Why do dental assistants always have to be so attractive? It’s very distracting.

I was wanting to embed my latest youtube video on my website. What I mean is, I wanted a simple embed script that would always show the latest video I’d uploaded. After discovering that Youtube doesn’t provide a simple way to do this I started googling to see if someone had written a script for it. I had no luck, so I’ve written one.

Taking use of some simple web scraping from the YouTube API, it’ll take the latest video from any Youtuber and embed a player with the what ever size the coder chooses.

It’s written in PHP and is just one function that can be called anywhere on your page. It takes three parameters: the username, the desired video width and the desired video height.

So here’s the first part which I recommend you place at the top of your page, I’ve commented it to help show what’s happening.

<?php
/*
Function to embed the latest video from a YouTube Channel.
Parameters: The username of the Youtuber, the desired width of the video, the desired height of the video.
Example call: get_latest_video(‘wormholer693′, ’640′, ’385′);
Author: Andy Barratt
Website: http://www.andybarratt.co.uk
*/

function get_latest_video($username, $width, $height)
{
        //Set the URL of the search we’re using to get the specified user’s uploads.
        $url = ‘http://gdata.youtube.com/feeds/api/users/’.$username.‘/uploads’;
        //Get the results from the url above and store them in a variable.
        $data = file_get_contents($url);
        //Create a filter to find the url of the first video in the retrieved data.
        $filter = "/<media:content url=’(.+?)’/";
        //Use the preg_match function to run our filter on our data and return scraped text then the filtered text (video url) in an array.
        preg_match($filter,$data,$results);
        //store our videoURL in a variable.
        $videoURL = $results[1];
       
        //if a video was found
        if($videoURL)
        {
                //generate the code required to embed the video.
                $embedCode = ‘<object width="’.$width.‘" height="’.$height.‘"><param name="movie" value="’.$videoURL.‘"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="’.$videoURL.‘" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="’.$width.‘" height="’.$height.‘"></embed></object>’;
                //echo the embed code
                echo $embedCode;
        }
        else
        {
                echo ‘No Video Found.’;
        }
}
?>

So the above is the actual function and below is how we call it, we just call the function stating the username, width and height of the video and it’ll do the rest. So just place the following bit where ever you want the video to appear in your code.

<?php
get_latest_video(‘wormholer693′, ’470′, ’283′);
?>

You can see this code in action on my Videos Page. Feel free to use it, I’d love to know what you think in the comments below.

Photos Page Added

3rd January 2011

Nothing special really, just a brief introduction to my photography, a couple of photos and a link to the flickr page.

Also, i’ve noticed that it’s not exactly obvious how to register an account on this blog to leave comments, I’ll get on that before starting on the videos page. Though… right now, I’m hungry, I’m off to McDonald’s.

You Can Now Download My Game

3rd January 2011

The game that I wrote as a project in third year is now available to download on the software page of my website.

Battle of the Crudely Drawn Dimensions is one of very few games which I believe is designed to be playable by both blind and seeing users. I’d love to know what you think, feel free to leave a comment on this post.

New Front Page

3rd January 2011

I’ve updated the front page of the website complete with a nice PHP powered Twitter feed which I think I’ve made work with the overall design of the site really well.

I’ve also decided to put a list of links on the bottom of the page. I used to avoid that sort of thing for google reasons but then, I’m not exactly marketing this site for anything, just more like an online portfolio of sorts.

Website Redesign

1st January 2011

I’ve been keeping notes on the front page of the website about how the redesign is going. I’m going to continue these notes here, on the blog, instead.

Here’s what I’d written so far:
Hello World
I’m doing a redesign of my website, it’s awfully exciting but if you get bored of waiting, the blog button up there is working ;)
No repeating Code
I’ve made a template which, with php include statements, every page on this site can use. That includes the title and navigation menu at the top and the fancy typography down the left hand side.
CV Page added
I’ve made the CV page active, my CV is actually what this site’s design is based on. Originally, the pretty design you see here was for my CV. It doesn’t look as good on screen due to the limitations of html and css but it’s pretty good and it sets the standard for headings, sub-headings and paragraphs throughout the rest of the site.
AXD Broke It :(
Well I’ve woken up this morning to find that my web hosts, AXD hosting, have moved all of my data to a new server. Unfortunately, they didn’t feel it neccessary to move all my extra domain names and sub domains, meaning all my extra websites are down… including the blog which I showed off earlier. -sigh-
Switched Web Hosts
Well although AXD got it fixed quickly, I’m afraid I’ve become tired of AXD faults so have switched hosts. I’m now with Unlimited Web Hosting UK let me list a few improvements I’m noticing.

  • They say on their website they’re in Manchester, I had no idea where AXD was
  • 24 Hour Telephone Support, compared with no telephone support from AXD
  • Fast set up, it was online the moment i paid
  • no contract – it’s a monthly payment and i can leave any time
  • All Inclusive Standard, they only have one web hosting package that includes everything, unlimited.
  • Cheaper! About £20 less a year
  • Testimonials from big companies such as NHS and 4oD
  • Transparency, they show off their uptime reports on their website

New WordPress Theme
If you click “Blog” you’ll see that the page style looks no different to this one. That’s because of a brand new WordPress theme I’ve been working on all day :-D.
It used to be that my blog was very seperate to the rest of my website. Now it feels much more like it is a part of this site.