Jun
18
“I like it. Simple. Easy to remember.” The words of Captain Jack Sparrow. And this is exactly how I feel about RESTful API’s.
What is REST? The Wikipedia definition says:
“Representational State Transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. The term was introduced in the doctoral dissertation on the web written in 2000 by Roy Fielding,[1] one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification, and has come into widespread use in the networking community.”
Do not let this put you off or confuse you! Lets look at a RESTful implementation to make things clearer. Lets look at YouTube’s RESTful API.
Lets say you want to write a PHP or Python or some script that gets your account details on YouTube and display them on a page.
All you need to do is to go fetch the output of a certain page and parse that output to get it working:
You read in the URL given by YouTube:
http://www.youtube.com/api2_rest?method=youtube.users.get_profile&
dev_id=YOUR_DEV_ID&user=YOUTUBE_USER_NAME
As you can see, this looks like a pretty standard link to a page in a site. Thats just it! It is! You can open this URL page in your browser. Obviously, YOUR_DEV_ID and YOUTUBE_USER_NAME should be replaced by the values you got from YouTube.
If all is ok, this “page” should return something like this:
<?xml version=”1.0″ encoding=”utf-8″?>
<ut_response status=”ok”>
<user_profile>
<first_name>YouTube</first_name>
<last_name>User</last_name>
<about_me>YouTube rocks!!</about_me>
<age>30</age>
<video_upload_count>7</video_upload_count>
…. and more ….
</user_profile>
</ut_response>
This looks just like XML, doesn’t it! Exactly. So you write your script to read the contents of the page that the given URL points to and parse this XML output it returns and do with it what you want to.
This is easily the easiest way of doing a web service you’ll come accross. Not only is it easy to consume the service, it is also easy to implement a web service this way!
Note, that there is a lot more to it. This is a simple, working example. I suggest you read all the Wikipedia page to get a better, more complete overview! You can however with this titbit of information, use the YouTube RESTful API!
technorati tags:RESTful, YouTube, API, webservices, REST
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming, web development Stii
Apr
20
It is amazing that some coders can not give a damn about how their code looks! I’ve seen it plenty of times while I was extending Joomla! compenents for client web sites. The coders simply do not give a h00t! They don’t worry about indentation. They follow no real coding standards. Naming conventions is non-existant. All in all, its damn ugly to look at.
The funny thing about it is that it still works! Although it is almost unreadable, it is stable and it does the job. And strangely enough, more often than not it is fairly simple to extend. It is just so straining on the eye… So obviously these coders are not stupid! They are simply messy…
All aspiring programmers: Make sure your code is “pretty”. It just oozes professionalism and could be a pleasure working with it when extending it! Spescially if it is an Open Source project. If others are going to work on it, then make it at least pretty to look at, please.
I guess this is one of the reasons why Python is so popular. Whether or not you are a sloppy programmer, in Python you HAVE to worry about indentation. At least when you open any Python sources, you know its going to at least look pretty. Python is gaining my respect more and more…
technorati tags:ugly-code, sourcecode, software-development, open-source
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming Stii
Apr
05
Nic Coyne is in need of a RoR developer down in Cape Town. He is even willing to take on good PHP developers who would be interested in learning Rails and teach them Rails development!
That is SUCH an awesome opportunity! So if you know of any developers with a passion to learn new things, this seems like an opportunity of a lifetime! I do not know what is on offer, accept for a great experience, so if you are interested, get hold of Nic through his blog here.

UPDATE: Here is the link to the original ad with all the requirements and skills you’ll need: http://lists.clug.org.za/pipermail/clug-work/2007-March/000341.html
technorati tags:rubyonrails, job-opportunity, capetown
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming, Ruby (on Rails) Stii
Apr
04

I’ve checked out Aptana a while ago and although it is extremely strong on the Javascript and HTML side, it sucked if you needed to do stuff in any programming language other than Javascript. Radrails was a free Ruby on Rails IDE. Better than your average commercial products I must say, but lacking in a few areas since it was a “young” project. Oh, and both were powered by Eclipse. A lot of people have mixed feelings about Eclipse…
Now an extremely interesting co.lab is happening! Radrails and Aptana joined forces! w00t!! Both these guys were on the right track, but they both lacked “something”. Joining forces might make that “something” disappear! I am really, REALLY going to enjoy checking this one out as SOON as I have time on my hands. I might even venture doing my first Rails project… who knows?
Just so you know, I have not yet fired it up and checked it out! Will tell you more later once I’ve done just that, but for now this is just too an exciting co.lab to keep it quite!
technorati tags:radrails, aptana, eclipse, rubyonrails
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming, Ruby (on Rails), Software Development Stii
Apr
02
While Ruby on Rails and Python is way ahead in the parsing of HTML for microformats, PHP is trailing behind it seems. We have found a couple of classes that can do it, but none without some quirks.
The one option was hKit which is a PHP 5.x parser. The problem with this parser is that it only works on PHP 5.x since it requires the SimpleXML PHP extension. Our problem is that not all PHP developed sites are running on PHP 5.x. That is not an ideal solution then.
The other option we found was the Microformats Parser over at PHPClasses developed by Ve Bailovity. This is an award winning class and is dependant of the xArray class also found there and also developed by Ve. This opion is much better since it works on PHP 4.3 or better and requires the DOM XML extension. The issue is that it does not work “out-of-the-box”. It worked beautifully when tested with the HTML file that accompanies the classes, but as soon as I tried it with some “real-world” microformat implementations (tried on http://corkd.com and http://www.thinkvitamin.com/), it failed. Sad, since it is a beautiful script!
So what do we need? We need a class that works on ALL versions of PHP and that can process ANY form of HTML or XHTML. We all know not everyone cares much for their mark-up and therefor you will find all kinds of funny and weird issues, so it must be extremely forgiving when parsing the HTML document. It must also have some proper security and anti-spam checks built in, since this could end up being a SPAMMERS dream if not properly protected! We’re on it.
We have started to develop our own parser class for kupa, aptly named kupaParser and will release it under the GPL for anyone who would like to take advantage of microformats on PHP. Will keep you updated on the progress as we go along.



technorati tags:kupa, microformats, semanticweb, php
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Kick-ass Tools, Open Source, PHP, Semantic Web, Software Development Stii
Mar
30
Below is a link to a demonstration screencast of how the upcoming Release 6.0 of Netbeans will support Ruby on Rails development. I cannot wait to try it, but accoring to the release schedule, we’ll have to wait for the beta release until May or June. Pity…
http://www.netbeans.org/download/flash/jruby_on_rails/jruby_on_rails.html


technorati tags:netbeans, opensource, ide, programming, rubyonrails
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Open Source, Programming Stii
Mar
27
I read a post last night on how the Python based Django web development framework kicks Ruby on Rails “collective” ass. (see: http://predius.org/blog/2006/12/05/why-django-kicks-ruby-on-rails-collective-ass/)
Blegh. I do not like statements like this. According to some tests ran Django is the top performer. Yet there is a lot more production sites out in the field developed on Ruby on Rails than there is on Django. So surely this adds weight when looking at the success of a language? Same for PHP and PERL. Lots of production sites there. A lot more than RoR and Django combined! Still people LOVE to gun down each other. What is extremely ironic is that Rails is (secretly) the benchmark whenever a MVC Framework is developed. No one would ever admit that, but we all know that is true…
One comment made sense in it all:
Up is better than down! Blue is better than Orange! Six is better than ‘Z’! Django is better than Rails!
No, seriously… It doesn’t matter. For most things, the advantages to
one or the other come down to very minor things. (My Django app runs 4%
faster than the comparable Rails app!)
Next… Ruby was only unknown to you. Just because the mass of
mediocre programmers had never heard of Ruby until recently proves
nothing.
Heres what it comes down to… Are you ready for this? …Which one do
you like more? You like Django? Bitchin’. I like Rails. Actually, more
specifically… I like Ruby, and don’t like Python. Its personal
preference, trying to ‘prove’ that one is better than the other leads
nowhere.
Want evidence? Try to find an argument where one side proves that
their language is ‘better’ than another. It doesn’t happen. Its a waste
of time and energy.
Go program something.
Full marks for this remark! True to the bone… So if you are an upcoming young developer, follow this guy’s advice and ask yourself the question: Which one (language / framework) do
you like more? That is what matters in the end…


technorati tags:django, rails, rubyonrails
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming, Techie stuff Stii
Mar
05
I spent a lot of the weekend looking into the Cherrypy framework. At first I found it very confusing. I was looking at it from a PHP and MVC framework perspective and could not exactly grasp why it is so popular and great as it claims to be!
Only after looking at the API and thinking about the first two lines on their home page, I realised what Cherrypy is exactly about.
From the home page:
CherryPy is a pythonic, object-oriented HTTP framework.
CherryPy
allows developers to build web applications in much the same way they
would build any other object-oriented Python program. This usually
results in smaller source code developed in less time.
You have to remember that PHP is a web development language. That was what PHP was developed for. Although you can manipulate the server and run commandline commands with PHP, it was not meant for that. Python on the other hand is exactly the opposite. It was meant to be a scripting language to manipulate the server and not exclusively meant for the internet. Python do have some great support for building web applications, but unlike PHP was not written exclusively for that.
So what is Cherrypy built for? Simple. It allows you to easily take your Python code and publish it to the web. You could do it without Cherrypy, sure! Using Python and CGI you can write kick-ass Python web applications. (Or mod_python if you use Apache) You will however need to know a bit of the HTTP protocol to do that. However, if you use Cherrypy, you don’t need to worry about any of the daunting HTTP protocol. Cherrypy will handle all that for you. All you need to do is write your kick-ass software!
Cherrypy is NOT a MVC (Model-View-Controller) Framework! That was the mistake I made when looking into Cherrypy. The MVC part of your application you will have to design and develop yourself. Python does make it easy for you, due to its Object Orientated nature!
That being said, Cherrypy does have a set of good tools. For example, it has tools to easily and without effort build in session management, build XMLRPC functions and a couple more!

technorati tags:cherrypy, http, webdevelopment, python
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Kick-ass Tools, Python, web development Stii
Feb
27
Since you were born, you have been experimenting with almost everything. You did silly things all in the name of (human growth) sience. Sometimes painful lessons were learnt. Most of the times new, great things were discovered.
I apply this in my daily life. I have never stopped experimenting. (Must add I keep the experimenting to my work, since thats my passion.)
Recently, I rediscovered Linux. Ubuntu to be exact. I’m loving every minute of it! A while back I talked to Neville Newey and ever since he told me that Muti was done in Python, I got that restless feeling in my ass. I am now spending “waiting time” looking deeper into Python.
Lucky for me Ubuntu with their Synaptic Package Manager made it extremely easy to set up CherryPy (CherryPy is a pythonic, object-oriented HTTP framework.) So, I’ll be experimenting forward with CherryPy, Django and the likes. I’ve heard NOTHING but great things about Django, by the way. Wins all the web framework shoot-outs. Even kicks the mother of frameworks’ ass! (Ruby on Rails)
Well worth a look into, I’d say! And for my loved ones, don’t look so scared! I’ll experiment in my own free time. No projects will be jeopardized due to my experimental fetishes!




technorati tags:python, cherrypy, django, linux, ubuntu, linux
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming, Python, ideas 2.0, web development Stii
Feb
27
I promised Derek Allard that I’ll be publishing some examples of how I integrated mootools with Code Igniter, but alas, I have not yet had made the time to just sit down and do it. I promise, Derek, soon!
I just want to add that I have not integrated mootools as an Code Igniter class or library. I should prolly, but here is my reason for not doing it. Two reasons actually:
- I’m too damn lazy… That and deadlines was WHOOSHING by again.
- I like my Javascript seperated from my PHP and Code Igniter classes!
I’ll focus on the second reason, since that one is easier to defend.
Firstly, let me just say once more that it is a matter of preference! I’m not arguing right and wrong here. Simply what I prefer and that can hopefully help you make up your mind if you have similar questions.
If you are going to integrate mootools with Code Igniter, you are going to write PHP that generates Javascript functions/classes. That for me is somewhat against the grain of the whole MVC philosophy. You already seperate your database access from your business logic from your HTML views. Now, you want to write PHP that generates Javascript just to make it easier to implement. What if you need very particular functionality? You will then have to want to stick with extending your PHP library to generate the appropriate Javascript functions. This is perfectly alright, but not always practical, since you might have certain time constraints.
There is of course a number of drawbacks you will need to consider when implementing mootools seperately, but more on that at a later stage.
Maybe I can be convinced that integrating it is better? I don’t know. It just feels more comfortable having it seperate.
technorati tags:codeigniter, mootools, javascript, php
Blogged with Flock
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Code Igniter, PHP, javascript, mootools Stii
Recent Posts
My Posse
Filed in
Past Stuff
Meta Stuff