Ehsanul Haque

Welcome to my personal site & blog

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.

 

14 Responses to “Patch for Grab Yahoo class released”

  1. Uday says:

    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

  2. Ehsan says:

    @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.

  3. Steve says:

    Well done, the patch worked like a charm!

  4. Luis says:

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

    Thanks a lot!

  5. Ehsan says:

    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.

  6. luis says:

    Thank you very much!! I really appreciate..

  7. 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.

  8. Ehsan says:

    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.

  9. hakara says:

    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

  10. Amit Shah says:

    Hey, cool stuff but it dose not grab contacts for yahoo messenger. It dose grab contacts from address book though. Can you please modify / update for the same.

  11. Ehsan says:

    The class is still working. Please check the demo site http://resource.bdwebwork.com/GrabYahoo/login.html

    I will send you the zipped package of the class

  12. Roberto says:

    Hi Ehsan!

    This script looks very good! I tried a month ago and it worked like a charm, but today, I try it again and it doesn’t work. It returns a crashed output…

    I’m digging into the code, but I don’t know how to fix this.

    Going directy through Yahoo website, I found a captcha just before getting CSV contacts. I’m not sure if this is related…

    Thank you very much

  13. Jagat says:

    Hi Ehsan,

    I have tried your script for fetching the Yahoo Contacts. But not getting the proper result.

    Can you please guide for the same.

    Thanks in Advance.

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment