Nerdburn - Web application & graphic user interface design blog by Shawn Adrian

Web site design by Shawn Adrian & friends

SimpleYouTube: PHP Class For Getting Video Details

Posted March 11, 2010

While writing a custom CMS for a client, I was approached with the request to enable it to accept any YouTube URL and add that video to a video gallery page on the web site. This turned out to be a lot easier than it sounds, and in this post I'm sharing the class I wrote to assist with the task.

Download It

Click below to download the file.

SimpleYouTube PHP Class
Free to download, modify, and use
Download (1.3kb, PHP File)

What Does It Do?

The class contains two methods (or functions if you're a beginner):

  • getVideoID($url) - Pass in any YouTube URL, the kind a client might copy and paste from the YouTube web site, and it will return the 11 character YouTube ID.
  • getVideoDetails($id) - Pass in a YouTube video ID, like the one acquired using the method above, and it will return the Title, Description, and Thumbnail information from YouTube, as an array.

See The Code

class SimpleYouTube {
                    
    // will parse the youtube URL passed to it and return
    // an 11 character youtube ID                
   function getVideoID($url)
   {
      // make sure url has http on it
      if(substr($url, 0, 4) != "http") {
         $url = "http://".$url;
      }
      
      // make sure it has the www on it
      if(substr($url, 7, 4) != "www.") {
        $url = str_replace('http://', 'http://www.', $url);
      }

      // extract the youtube ID from the url
      if(substr($url, 0, 31) == "http://www.youtube.com/watch?v=") {
         $id = substr($url, 31, 11);
      }
         
      return $id;      
   }

   // will accept a youtube video ID
   // returns title, description, thumbnail
   function getVideoDetails($id)
   {
      // create an array to return
      $videoDetails = Array();
      
      // get the xml data from youtube
      $url = "http://gdata.youtube.com/feeds/api/videos/".$id;
      $xml = simplexml_load_file($url);
      
      // load up the array
      $videoDetails['title'] = $xml->title[0];
      $videoDetails['description'] = $sxml->content[0];
      $videoDetails['thumbnail'] = "http://i.ytimg.com/vi/".$youtubeID."/2.jpg";

      return $videoDetails;
   }

}
?>

That's it - again, it's a pretty simple class, but it does a nice clean job of what it's meant to.

Time Tracking - Hassle or Help? Freckle Enlightens

Posted March 3, 2010

I have a confession to make. I've been designing web sites for almost 15 years, in a variety of capacities, and I had never once logged my actual working hours... until late December of 2009, when I met Freckle, Amy Hoy and company's latest app. Oh, I had an awareness of how long things took, of course, after years of practice I can quote almost exactly the number of hours a specific job will take (give or take a few). But I'm not talking about guesstimating how long something will take, I'm talking about recording how long something did take, in actuality. I had yet to experience the cold hard facts, the truth, which strangely, has set me free.

I'm sure you're familiar with the day in and day out stress of carrying on business. You're balancing multiple projects, you're on the phone, you're trying desperately to focus and achieve - but there never seems to be enough hours in a day. I can relate.

Hassle Or Help?

When I came across Freckle at first, I was impressed with the pretty, usable interface, and made a mental note to try it out so I could write an article about the interface. I had always imagined that time tracking was going to be a hassle. As mentioned, I've been doing this for years and I make a good living from home, why should I track my hours?

Anyway, I signed up, I chose the "Solo Plan", and what immediately jumped out at me was the simplicity with which I could track my hours. This had obviously taken some thought, and it was executed with precision.

I'll spare you all a detailed play by play of the last couple of months and get right to the meat and potatoes of this article. Tracking my hours has been very enlightening and very freeing, and a huge help. I would recommend Freckle to anybody who doesn't mind shelling out $12 per month for a deeper look at their working habits.

A Closer Look

I learned a few things after a couple of months tracking my hours.

  • I actually work less hours than I thought I did (what a surprise when I feel like I'm working all the time!)
  • I should re-think my hourly rate
  • Time tracking is an incredibly valuable tool

I'll flesh these out in more detail below - let's take a look at some screen shots, because I know that's what you're here for.

A Big Home Page

When grabbing the screenshots for this JPG I was surprised how long this home page is! Almost 3000 pixels long! But hey, it's converting visitors into real customers (aka, me) so I'm not going to fault it. I'd be very curious what the conversion rate is for this site.

LetsFreckle Home Page

I love the choice of colors on this page, and the Slash7 mantra that software should be cheerful. Great concept and excellent execution.

Simplified Plans & Pricing Page

Ok, my first though about this page was that the layout changed... why? I can only guess and say that they've stripped all unrelated content from the page, including the more detailed top navigation that was on the home page, in an effort to focus users attention on the plans and the signup links. On the other hand, it could be that they were designed at separate times...

LetsFreckle Plans Page

Informative Signup Page

The signup page includes description boxes to the right of the fieldset, and a clearly laid out form, including a radio button with an image for the type of credit card, which is a nice deviation from the select boxes many forms tend to take.

LetsFreckle Signup Page

Unique Log In Page Design

The log in page is worth a mention because of the bright colors, right alignment, and the way it's situated in the browser window. It's a unique view of a log in page, and it makes me smile every time I log in, which must do something for usability, right?

LetsFreckle Login Page

Interactive Dashboard

I love the dashboard on this app because it's completely interactive. Rather than just grabbing bits of information from the other sections of the site, and giving a snapshot of where I'm at, the dashboard here does that, and also allows me to interact with the content. I can add hours by filling out a quick form at the top, with no need to use my mouse, and I can edit a time entry by pointing at it.

LetsFreckle Dashboard Page

Keeping On The Pulse

I really enjoy how this page, which is just a quick monthly reporting of where my hours have gone, is called the Pulse. It gives me a clear, visual snapshot of where my hours have gone each month. You can drill down for more info on tags, hours, projects, or people by clicking on them.

LetsFreckle Pulse Page

Enlightening Project Page

I mentioned earlier that one of the things I learned from time tracking was that I should re-think my hourly rate. I've found that I'm usually coming in under budget on the number of hours I spend on each project lately. I must be getting faster! Getting faster is good news, and good reason to re-consider ones hourly rate. This page is enlightening because it shows the number of hours spent, how many are remaining in the budget, and helps to keep things on track and on budget.

LetsFreckle Project Page

Wowing Customer Support

You may have noticed those little pink "feedback" buttons on the left hand side of each page. Often they indicate a GetSatisfaction account, which is a great way to submit ideas, but not a great way to have a conversation, in my opinion, unless the company using it is constantly on GetSatisfaction. Freckle receives bonus points in my book for building what looks like their own feedback system.

Clicking the pink link pops up a feedback window where you can give advice or ask a question. I used it twice, and both times received a personal email back, from Amy, about my idea or issue and what they were doing to solve it. Great customer support, and what a way to build relationships with users. Kudos.

Time Tracking Has Been a Big Help

To sum up, time tracking has been a big eye opener and a real help for me. My productivity has increased, because my estimating has become even more accurate, and I have seen how much time I spend goofing off during the week. You'll remember I was surprised to find I had only logged an average of 30 hours per week. That works out to 2 hours less per day of actual working time than I would log for a full 40 hour work week. What am I doing with those hours? I suppose lunch counts for one, but the other must just be Twitter, blogs, coffee breaks, etc. Very interesting data to work with.

If you're not tracking your hours, I suggest you start. And what better place to start than Freckle? You can try it free for a month, and if you decide it's worth it, then you can continue using it and paying for it. I bet you'll decide it's worth it.

What Do You Think?

Do you track your hours? Have you used Freckle? I'd love to hear your opinion in the comments, especially if you have some useful bit of data about your working habits that you've mined from your hours.

QuoteRobot: Helping Designers Create Quotes & Win Jobs

Posted January 4, 2010

My good friend Jon and I have been working over the holidays on a dream of mine I had a couple of years ago called QuoteRobot. It's a web app we're building that will help designers and coders create quotes and win jobs, and we're both pretty excited about it.

I figured I'd post about it and show a few comp screenshots. This is all in development, but I welcome your feedback and comments. Feel free to check out the splash page here.

A Few Screens

Here's one of the splash page:

Splash Page

Here's one of the upcoming home page:

QuoteRobot Home Page

Here's a concept of the creator (lacking some color at this point):

QuoteRobot Creator

Here's an edit on the handles for pages:

Handles Edit

Unique Features

QuoteRobot was created in response to the popularity of my free web design proposal template. The idea is to take a tedious process like creating quotes and proposals, and turn it into something that's fun, and really easy. Here's how we intend to accomplish that:

  • Drag & drop pages: Need a title page on your quote? Drag the template from a list onto the canvas and fill out the resulting form.
  • Social line items: QuoteRobot will remember line items from the whole user base, and you'll be able to rate, comment, and use them as you wish. This will (hopefully) take the guess work out of quoting.
  • Multiple templates: Although we'll launch shortly with only one template, we will eventually allow the addition of user-generated templates.
  • Output to PDF, web, and email: Send the quote / proposal to your client the way you want to.
  • Immediate acceptance & feedback: Once your client receives the quote, they can click to accept it, comment on it, or refuse it, so you know where you stand immediately.

Help Promote QuoteRobot

Please visit QuoteRobot, subscribe to the email list, and post, tweet, blog and IM about it! Jon and I both work full time and are crunching this out in our spare time so it's a lot of work, but we're dedicated and determined to help designers like us quote better.

View older posts »

About The Author

Shawn is a 28 year old freelance graphic and web application designer in Vancouver, BC, Canada. His other project is called QuoteRobot and it's coming soon!

Graphic Design Blogs - BlogCatalog Blog Directory

Blog Directory for Canada