Category: Code

 

 

March 11th, 2010
C

PHP Viddler API Client – Forked

Okay that title sounds either a bit naughty or nasty, it’s neither. I forked the official PHP Viddler API wrapper and wrote a new one. Why? Well because when I worked there I wrote smaller client which worked out well for me so I’ve decided to release it.

If you strip out the comments from the new client, it’s less than 200 lines of code. Now I just focused on the core API, I didn’t add any of the add-on methods for embeds, oembed, etc. If you are looking for those I would suggest using the original Viddler client. I wanted to keep this lightweight, I may add it later on as an extension so if you want to use it you can, but for now, just keeping it simple.

So how did I strip so much out of the original? I used no 3rd party classes. I used only what is in PHP. I ditched the xmlparser.php file and went with SimpleXML. I also didn’t write a method for every for every possible API method. Actually I didn’t write one for any of them. I took advantage of PHP’s magic method __call(). Which is automatically called when the user calls an object method that doesn’t exist.

$viddler = new Viddler('API KEY');
$res = $viddler->user_auth(array(
  'user'      =>  'USERNAME'
  'password'  =>  'YOUR PASS'
));

CONTINUE READING | TWEET THIS | COMMENT (1)

March 5th, 2010
C

Simple Tag Bar for WordPress

So when I did the little redesign of my site earlier this week I added a right rail. With that I wanted to add some way to show tags that was not a tag cloud and wasn’t just a list of tags. I noticed on a co-worker’s blog (Kyle Slattery) that he had a really nice tag display. So I stole it, er better yet re-purposed it. The way Kyle did it reminded me of how Django makes its graphs, very clean and crisp. I really liked the idea and the presentation.

He doesn’t use WordPress so I had to build a quick script to accomplish this in WordPress. Easy enough actually. What it does it grab your top ten tags then do a little math to display them in a graph format. The more times a tag was used, the larger the graph. Again pretty simple.

CONTINUE READING | TWEET THIS | COMMENT (3)

January 21st, 2010
C
L
M

Welcome to Phraction

Wow, it’s been a heck of a long time but things have calmed down (a bit) and I decided to bring my blog back to life. When I last left off I was using this space for a side-company that I used to do web development and design for. It was my company named ‘Phraction’ and we would do simple local sites, job boards, etc.

Since that time I began working harder at The Morning Call in Allentown, PA and I am now currently working at Viddler. My wife and I now have two kids, we recently moved and a loving yellow lab named Farley.

I intend to use this space for a few things I am passionate about: Life or my family, Music and Code. Pretty much in that order. I have a wide variety of other things I like to do such as run, play Mario Brothers, have a random or not so random Rum and Coke, but in large those are the most important things in my life.

So I quickly made this template (Work-in-Progress) and I am writing this post. Well that about sums up where I am coming from, so watch this space for some meaningful and well quite frankly some not so meaningful insight.

Regards and thanks for reading.

CONTINUE READING | TWEET THIS | COMMENT (0)