inicio mail me! View Ehsanul Haque's LinkedIn profile sindicaci;ón

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.

Tahmid Munaz said,

August 21, 2007 @ 3:37 am

Good job! :)

Uday said,

August 21, 2007 @ 11:07 pm

Well Ehsan Bhai , I did not understand what you did with the “Crumbs” thingy……

I just wanted to thank you for the grabYahoo class.
I have learned a lot about how to use curl , about using classes effectively and many new things about parsing data and PHP as a whole.
Your coding style is very ‘beautiful’ and the comments that you have posted are exceptionally helpful.

You know, I’m the guy whom you offered to help to finance his website………

Take care

Ehsan said,

August 22, 2007 @ 4:59 am

@Tahmid: Thanks….

@Uday: I remember you! It is good to know that you have learnt so much from my work and thanks for the compliments. “crumb” is a randomly generated key used by Yahoo to verify whether the request is valid. The value for the “crumb” was always randomly generated but never checked whether it has expired or not. Now they verify this key. With the Patch this class first looks for the crumb generated by Yahoo in the form and uses it to request for the address book CSV.

It was good to see my class’s ranking on phpclasses.org today. It now ranks 18, which was ranking at 102 before I released the patch. Thank you to everyone who downloaded my class and reported bugs from time to time.

Steve said,

August 23, 2007 @ 2:37 am

Well done, the patch worked like a charm!

Luis said,

August 27, 2007 @ 11:55 pm

I like so mucho your class that I’m trying to translate to c#.net..
Does anyone try to do this?

Thanks a lot!

Ehsan said,

August 28, 2007 @ 5:09 am

Thanks Luis. As far I remember one person converted the class to .NET. His name is Ramesh. I will see if I can send you his contact information.

luis said,

August 28, 2007 @ 5:20 am

Thank you very much!! I really appreciate..

RSS feed for comments on this post · TrackBack URI

Leave a Comment