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.
![[del.icio.us]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/facebook.png)
![[Feed Me Links]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/feedmelinks.png)
![[Google]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/linkedin.png)
![[StumbleUpon]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/technorati.png)
![[Twitter]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/twitter.png)












Tahmid Munaz on August 21st, 2007
Good job!
Uday on August 21st, 2007
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 on August 22nd, 2007
@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 on August 23rd, 2007
Well done, the patch worked like a charm!
Luis on August 27th, 2007
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 on August 28th, 2007
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 on August 28th, 2007
Thank you very much!! I really appreciate..
Moshfiqur Rahman on August 25th, 2008
nice blog!
Some days ago I tried your GrabYahoo class but it didnt work for me. I didnt try it yet after you released the patch. Now it should work.
Anyway, do you have any idea regarding Yahoo address book api? I am working on it but getting a nasty error. I was searching for the solution then found your blog. I hope we may get a post on this. Thanks.
Ehsan on August 27th, 2008
Hi,
Thanks for visiting my blog. GrabYahoo class is working and you can try it on my demo server http://resource.bdwebwork.com/GrabYahoo/ which has the latest code.
Try to download the latest package from phpclasses.org and let me know if it works for you. Otherwise I can email you the code.
I’ve not tried the Yahoo API but I may do it soon. I will let you know as soon as I do so.
Thanks.
hakara on September 15th, 2008
http://hankara.110mb.com/laylist/login.html
It’s don’t work!
please send me code on Email.
I feel this code very well
Thank you