Categories
Personal Work

My First WordPress Theme: maSnun.com gets a new look!

It’s been a really long time I have been with WordPress 🙂 I installed wordpress first on a separate sub-domain and liked the power and flexibility of WP. Later I moved the installation directly to https://masnun.com . During this period, I have switched from one theme to another. What I have looked for is simplicity and lots of customization. Obviously none of the themes could satisfy me. I have used some really great themes and appreciated their beauty in this post but all these were overkill for me. I am a simple guy and want everything to be as simple and plain as myself.

I have always wanted to do something with WordPress API by adding Google Analytics to WordPress but couldn’t really concentrate out of laziness. After my first WP plugin became a hit one, I decided to dig deeper into the WP API and then Hasin Vai asked me to study on WP Theme Development. I was looking for this. He sent me the book “WordPress 2.8 Theme Design” by Tessa Blakeley Silver. The book was good theoretically but like always, I didn’t like the idea of reading all those texts. I just skimmed through. But it gave me basics and the confidence to do something with WP Theme Development.

Today afternoon, I started building my first WordPress theme and here it is 🙂 I have built it, maSnun.com gets a new look of it’s own! 🙂 This is of course a hacked version of the famous “default” theme — Kubrick 🙂

The theme I have written has no images – plain HTML and CSS. I have willingly removed the sidebar and ability to add widgets. Instead, I have some plans to put in some static contents to fill up that space. This is just a rough version. I am not very good at CSS and styling. I am basically a developer. So my design was simply rubbish! But the positive side is I have learnt the curves of WP theme development, at least the php portion.

The efforts contributed a lot to my HTML and CSS knowledge as well. It was really a cool experience working it out!

I just love WordPress! 😀

Download: http://masnun.googlecode.com/files/masnun.com-2009-the-wp-theme.zip

Categories
PHP

Google’s Text to Speech API : A PHP Wrapper Class

It’s really amazing how Google is providing cool APIs for every this and that! And here comes another one that impressed me 😀 I am talking about the Text To Speech API by Google. It’s fantastic! I wrote a php wrapper class that would help you create mp3 files from texts 🙂 Of course, using Google as the medium!

Here’s the source code:

And here’s demo :

You can alternatively pass the text to the constructor of the object like this:

That is simple, isn’t that? Hope you like it!

Categories
PHP

FeedParser: A PHP Class for Quick Feed Parsing

Well, it doesn’t require any further explanation — we the web developers know how often we need to parse feeds. It’s a very common practice to use SimpleXML for parsing feeds. But today Hasin vai (Hasin Hayder) showed me a very cool thing — the Google Feed Parser. It’s a web based feed parser that is internally used by Google. The coolest thing about the parser is that it returns data as JSON 🙂

Seeing the point, I quickly fired off my netbeans IDE and wrote a php class for quick feed parsing 😀 Why fetch the feed and then parse it? Let Google handle the parsing and fetch the parsed results 🙂 Google is really making our lives simpler!

Here’s the class definition:

So, how do you use it? Initiate a new FeedParser object and then call the parse() method with the feed URL and entry count. The second parameter is optional and is “5” by default.

So what do we get in the $data array? Good question, lets see :