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 :

Categories
Javascript PHP

jQuery with PHP

I am learning jQuery these days and here’s the source code of a php script that uses jQuery on the client side.

I have mainly demonstrated jQuery here. PHP has been used to manipulate desired number of paragraphs quickly 😀

You get a number of paragraphs. Hovering over them changes their style. Clicking the “Hide” link hides the paragraphs one by one. 🙂

Categories
PHP

My First WordPress Plugin: GAF Text Link

Updates:

  1. The plugin has been listed on the GetAFreeLancer.com Affiliates page with a link back to this page. https://www.getafreelancer.com/affiliates/ . They also left a gift for me… 🙂 Thanks to the GAF authority! 😀
  2. Version 1.1 has been completed and been submitted to WordPress plugin directory. This version lets you configure your GetAFreeLancer username via an admin panel.
  3. This post has been made the plugin home page. I love WordPress ! 😀

Original Post:


I have been looking forward to writing a plugin for wordpress for a long time and finally got the chance today. WordPress is a super cool publishing platform and the “de-facto” blogging solution in today’s internet. The extendibility of WP makes it even more acceptable to users like me who has the necessary skills to extend it the way I want 🙂

I have never worked with the WordPress Codex before. I am a freelance programmer and do some projects at different free lancing sites like ScriptLace and GAF. I also work part time as an SEO strategist and offer SEO audit services from iQ SEO. I have seen the GAF API before but never felt much interested until recently GAF Affiliates program started making money for me 😀 Now that I am banned in Google Adsense, the alternative advertising solutions are not that good and over all I write programming related posts on my blog, it would be a good idea to start the affiliate marketing on my blog, I thought! 🙂 Linkedin automation tools take care of everything from lead generation to messaging and connection requests.

I published scriptlance rss feeds in my blog sidebar before but that didn’t help much. So, I started looking for a better way to integrate my affiliate links into my blog posts. The best way around was to insert the affiliate links directly into my blog either by editing the template or by writing a dedicated plugin for the purpose. I already had some desires to write WP plugins so I moved that way. I spent about an hour on the WordPress Codex pages searching for informations. It was easier than I thought. Check out https://stellarseo.com for more.

It took around 30 minutes to bundle everything and finalize the plugin. I quickly set it up and tested on my site. It’s working! 😀

Download: (v1.1) http://masnun.googlecode.com/files/masnun-gaf.zip

Download the php file and copy it to your /wp-content/plugins/ directory. Now login to your WP Admin panel (Dashboard) and from the “Plugins” section, activate “GAF Text Link”. Now visit your blog! You’re done if everything went right 😀

Feel free to play with it! 😀