Ehsanul Haque

Welcome to my personal site & blog

12 January
0Comments

Grab Yahoo class is in “coma”

Grab Yahoo class was one of my works that has been used by many people around the world. Since I released this class I did  not have a single month without comments or questions or suggestion about this class. Some people have copied the class, released it under their name (simply taking out my comments and added their own) to increase traffic to their site probably. But more importantly this class was appreciated by many. This was one of my finest contribution to the open source world.

How did I come up with this idea?

Well, I cannot remember which user group but in one of the groups I participate in had a discussion over if PHP can pull data off from places like Yahoo and use it for some purpose. Users on the group said this can be done (easily) with Java, but cannot be done with PHP. So I started researching over it. I found the cURL extension for PHP which seemed the good candidate to do the job. So I started working on it. After days of coding I finally wrote a script that will allow someone to login to their Yahoo account and fetch data from their address book. Initially I simply had a script but then I converted it to a Class allowing people to grab their address book, messenger list, number of new emails and calendar data.

What is happening now?

As per the title of this post this class is in “coma”. The reason is the update to Yahoo address book export mechanism. They have placed a CAPTCHA validation page in the export feature and, therefore, my Grab Yahoo class cannot go any further to grab the content it needs. Same thing happened with the LinkMeIn class which stopped working after LinkedIn added the CAPTCHA validation.

Why is this class in “coma”?

I have looked at the Yahoo address book export feature and found the CAPTCHA validation which will not allow the class to work. But I’ve not done my complete research on it yet, to make sure there is no other way to make this class functional. So, for the time being, this class is in “coma”. If I fail to revive this class I will probably officially pronounce it “dead”.

Can you help?

Yes, of course, you can. I hardly have time, these days, to sit with these side projects. If anyone from the community has time to research and help me revive this class it will be appreciated. Your name will go into the credit section of the class, well that is all I can offer!

15 May
3Comments

Redirect with .htaccess file

Ever wanted to redirect users from one domain to other or one sub-domain to other without compromising the the file path or query string variables? I’ve come across the requirement when I published my WordPress blog.

For testing, I initially installed WordPress on a testing sub-domain, where I imported all the blog entries and added blog-roll links. After doing so, PHPClasses.org picked up my entries for Grab Yahoo, LinkMeIn and MySpace profile updater as track-back links. Later when I switched to my main sub-domain, I’d to find a way to keep the track-back links as is, and redirect users to the proper locations. The trick was done by .htaccess file.

After reading the apache’s documentation on mod_rewrite module, I’ve successfully implemented it. If you want people accessing http://sub1.yourdomain.com/2/12/some-post-of-yours/ to go to http://sub2.yourdomain.com/2/12/some-post-of-yours/ then in the root of sub1 (first sub-domain) create a .htaccess file and add the following lines:

RewriteEngine On
RewriteRule (.*) http://sub2.yourdomain.com/$1

I have not read much and not sure if there’s any other option to do this more efficiently; but this trick has served my purpose.

31 August
8Comments

LinkMeIn – my new class released

Today my new class LinkMeIn was released on PHPClasses.org. I have developed this class about couple of months back but did not have enough time to sit and arrange the files to upload on PHPClasses.org. After Grab Yahoo and MySpace Profile Updater classes this is my third class for same type. This class allows any registered LinkedIn.com user to enter their login information and get the contact list. The list is returned as an array or RSS 2.0 format.

I will update LinkMeIn class in future to add more functionalities to it. For the time being if you want to test it, please visit the LinkMeIn Demo location. To report any bug please use PHPClasses.org Support Forum and if you want to contact me directly please go to the Contact section.


Thank you

24 August
4Comments

New functionality for Grab Yahoo

I have added a new functionality for the Grab Yahoo class. Soon after I released the patch, I figured out that I could add this new functionality which did not take me much time to implement. This new feature will allow you to grab your Yahoo! Calendar in an array format.

Using Yahoo’s calendar export feature, I grab the CSV file and parse it to form an array. This was a very simple addition as it uses same method as Address Book parsing. Only thing that was different was the way I had to parse the CSV, which Yahoo creates for Outlook. I don’t have any further plan to upgrade this class but do have other plans to build similar web service based classes.

Please download the latest version of grab yahoo class (v.1.3) here.


Thank you.

20 August
14Comments

Patch for Grab Yahoo class released

Last week suddenly my Grab Yahoo class stopped working for Address Book section. After Mr Mandy Singh reported the bug on phpclasses.org discussion board I started digging to resolve the issue.

When requesting the address book CSV from Yahoo a value for the key “crumb” is sent in the query string. Earlier Yahoo never checked for the validity of the variable but they have changed the way it is used. Now they check if the value for “crumb” is valid or not. As my script was using a predefined value and it has expired, Yahoo server could not validate. Yahoo was showing an error stating “Invalid or missing crumb”.

I modified my class so that it first loads the page from where request for the CSV is made. From the source of the page, it locates the latest value for crumb assigned by Yahoo and uses that value to send request for the address book CSV file. It is now working as expected. If you find any bug please report it on phpclasses.org discussion board.

Please download the latest version of Grab Yahoo class (v. 1.2.1) here.


Thank you.

25 May
4Comments

Grab Yahoo Class on phpclasses.org

Today my class titled Grab Yahoo has been published on www.phpclasses.org.

This class is a collation of my previous two scripts in PHP to grab Yahoo address book and messenger list. You will have to provide your
Yahoo account username and password to it which will return an array of the list of your choosen service (Address Book or Messenger List).

This will be useful in a way that anyone willing to provide the service like upon user registration to the site, you ask the person to invite people on their Yahoo address book etc. Similar to what Hi5, Name Database etc does.

Please visit the download page here to download the class pack.

Visit the discussion board to post any suggestion, comment or bug to report.

Please don’t forget to rate my script.

Visit this page to see the demo.
~~Thanks to all and God Bless!!~~