Wednesday, August 10, 2011

XBMC TV v0.1 - Streaming XBMC Plugin

I'm happy to announce the initial release of my XBMC Plugin, XBMCTV.  The XBMCTV plugin provides easy access to thousands of streaming videos from many sources around the net.  The plugin requires XBMC Dharma, if you're not familiar with XBMC you can read up about it here.

The current features:
Around 2000 videos available
Browse videos by category
View latest videos
Browse by channel
Browse by show


The latest version of the plugin can be found here:
http://jamespcole.com/xbmctv/www/plugin_builds/

To install the plugin just follow these steps:


Download the ZIP file and save to a location accessible by XBMC.

Open XBMC and browse to System > Add-ons > Install from zip file.

Browse to the file you downloaded and select it.

source

After installation the plugin will appear under Videos > Video Add-ons > XBMCTV


At the moment the video collection is limited to a few thousand streams so if you have any video RSS feeds you want added then leave a link in the comments below.  Also any feature requests are welcome just leave them in the comments.


Saturday, August 6, 2011

Elementery OS Jupiter Review

I've been using Elementary OS  on my home development machine and netbook for a couple of months now and I have to say I'm pretty pleased with it.  The current Elementary OS is based on Ubuntu 10.10 and is bought to you by the same team that creates the highly popular elementary themes and nautlius customisations for Ubuntu.  I guess I woud call Elementary more of an Ubuntu remix than a full fledged distro, it's essentially the Ubuntu core with a different set of default installed apps and all the elementary team's sweet eye-candy and themes pre-installed and configured.

The default desktop configuration, looking minimal and quite spartan.

You'll get smaller set of installed apps compared to a regular Ubuntu install but the software center is pre-installed so you can install anything you want in just a couple of clicks.  One of the things that lets the current release down in the default browser which is Midori, it looks nice and is webkit based but just isn't ready for general use yet, it has a ton of bugs and felt really unstable.  No problem though you can just install Chrome, Chromium or Firefox easily.

Ubuntu Software Center in Elementary OS

The choice of colours and icons in Elementary makes it look a little like OSX which I was put off by at first, being a big fan of dark themes.  Fortunately the rest of the Elementary configuration is very similar to the way I like to customise my Ubuntu setup anyway, with a minimal look, Docky, desktop icons turned off and elementary nautilus etc.  However the Elementary theme gives the whole OS a light and breezy feel which makes it a pleasure to use and somehow seems much snappier than a standard Ubuntu install.  Perhaps due to the smaller number of pre-installed apps.  Although after a while you notice the similarity to OSX is only slight and that the UI/UX is actually quite different.  I also added compiz to my setup for some extra bells and whistles and as you would expect everything works flawlessly.

Compiz widow switching in Elementary OS

Compiz workspace switcher Elementary OS

While the current 'Jupiter' release is bassed on Ubuntu 10.10 the new 'Luna' release will be based on Ubuntu 11.10 and should be arriving around November.  The upcoming 'Luna' release will bring a whole bunch if improvements including Elementary's very own app launcher alled 'Slingshot'.

Overall the first release of Elementary OS is a great start and even though it is a first release it is very stable and I have been using it every day with no issues.  So if you want a fast, pretty and lightweight version of Ubuntu then give Elementary OS a try.

Tuesday, July 19, 2011

AMOLED Screens Will Change the Future of UI Design

The latest Super AMOLED Plus screen such as the one featured in the new Samsung Galaxy S II will begin having a real impact on UI design.

Why is that? you ask.

The latest generation of AMOLED screen use little to no power when displaying black pixels.  This means that on a mobile devices it is much more power efficient to use black pixels as much as possible.  I think this will mean that in the coming years mobile devices will increasingly use darker UIs in order to increase the battery life of their devices.  Android seems to have already made the decision to have black backgrounds on their UI quite a while ago and it makes me wonder whether this choice was purely aesthetic or a very far sighted engineering decision based on the likelihood that in future mobile screens would have 0 power black pixels.

Does this mean we could see a revision of the rather light iOS UI in the coming years to a more efficient and stern black based UI?  Probably not,  but it is interesting that the latest Meego builds for the N900 also use a light coloured theme by default but in the upcoming Nokia N9 running Meego with an AMOLED screen they have opted for a very black theme. See here: http://www.engadget.com/2011/06/21/nokia-n9-first-hands-on/

Anyway only time will tell but for my $0.02 I'd say that in future of UI design black is the new black.

Thursday, June 9, 2011

Enable Docky Settings in Elementary OS

I've been testing out the latest Elementary OS(Jupiter) on my Netbook. Elementary uses Docky as the default dock, it's a great app and I have used it extensively on standard Ubuntu. By default the dock does not autohide and on my 1024x768 netbook it's using way too much screen space. For some reason the Elementary team have decided to hide the dock settings by default.

To enable the Docky settings icon to appear in the dock do the following:

Open a terminal by pressing Ctrl + Alt + T or using the menus go Applications->Accessories->Terminal

Enter this at the terminal and hit enter:

gconftool-2 --set "/apps/docky-2/Docky/Items/DockyItem/ShowDockyItem" --type bool "true"

The Docky settings icon should appear on the left hand side of the dock.

It's the anchor icon on the far left

Alternatively you can do it via a GUI using gconf-editor.  To start gconf-editor open a terminal type gconf-editor and hit enter.

Select the "ShowDockyItem" option



Tuesday, June 7, 2011

Installing LAMP on Ubuntu 11.04 Natty Narwhal

This is a short guide to setting up LAMP(Linux, Apache, MySQL, PHP) on Ubuntu 11.04 Natty Narwhal.
If you are using 10.10 you can check out my LAMP setup guide here.

First step is pretty easy, open a terminal and enter the following:

sudo apt-get install lamp-server^

During the installation process you will be asked to enter you MySQL root password, after that you have a basic lamp stack set up.

The following steps are optional but recommended:

Install CURL for php.

sudo apt-get install php5-curl

Install mod rewrite for url rewriting.

sudo a2enmod rewrite

sudo gedit /etc/apache2/sites-available/default

This will open your sites config file, now find the XML block that looks like this:

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

change the AllowOverride directive from "None" to "All".  The result should look like this

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

now save and close the file.



Next restart Apache for the changes to take effect.

sudo /etc/init.d/apache2 restart

And that's it, happy coding!

Installing Google Chrome in Ubuntu 11.04 Natty Narwhal

The deb package from Google Chrome download site does not currently work with Ubuntu 11.04(Natty Narwhal).  Luckily it's easy to just add the chrome PPA and install from the command line.

Open a terminal(Ctrl + Alt + T) and enter the following:

sudo -s

echo "deb http://dl.google.com/linux/deb/ stable non-free main" | tee -a /etc/apt/sources.list

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -


apt-get update

sudo apt-get install google-chrome-stable

exit

And now chrome should be installed, have fun.

Wednesday, February 16, 2011

Simple PHP oAuth example for Facebook Graph API

I needed to implement oAuth for the the Facebook graph API today and couldn't find any straight forward php examples so I thought I would post this in case any else is in a similar situation.

The basic process for the authentication is outlined here so I won't go into the details of it.  In the example below the bit you'll need to take note of is the "scope" parameter in the link, this defines the permissions you are requesting.  To see a full list of available permissions click here.

You'll also need to sign up for an API key first and register your application with Facebook, you can sign up here.

Step 1:
In your page make a link like this:

<a href="https://www.facebook.com/dialog/oauth?client_id=<?=FACEBOOK_APP_ID?>&redirect_uri=
<?=urlencode('http://yoursite.com/fb_oauth_return.php')?>
&scope=offline_access,user_checkins,friends_checkins">Connect with Facebook</a>

Step 2:
Create a page called fb_oauth_return.php which contains the following code

<?
if(!isset($_GET["error"]))
{

 if(isset($_GET["code"]))
 {
  $code = $_GET["code"];    
  $url = 'https://graph.facebook.com/oauth/access_token?client_id='.FACEBOOK_APP_ID.'&redirect_uri='.urlencode('http://yoursite.com/fb_oauth_return.php').'&client_secret='.FACEBOOK_SECRET.'&code='.$code;
  
  $curl_handle=curl_init();
  curl_setopt($curl_handle,CURLOPT_URL,$url);
  curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,6);
  curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
  $buffer = curl_exec($curl_handle);
  curl_close($curl_handle);    
  if(strpos($buffer, 'access_token=') === 0)
  {
   //if you requested offline acces save this token to db 
   //for use later   
   $token = str_replace('access_token=', '', $buffer);
      
   //this is just to demo how to use the token and 
   //retrieves the users facebook_id
   $url = 'https://graph.facebook.com/me/?access_token='.$token;
   $curl_handle=curl_init();
   curl_setopt($curl_handle,CURLOPT_URL,$url);
   curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
   curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
   $buffer = curl_exec($curl_handle);
   curl_close($curl_handle);
   $jobj = json_decode($buffer);
   $facebook_id = $jobj->id;
   
   
  }
  else
  {
   //do error stuff
  }
 }
}
else
{
 //do error stuff
}
?>

And that's it.  If you requested offline access you'll need to save the token to your database so that you can use it to make requests on the user's behalf later.