-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grab year of birth #40
Comments
The year of birth is unfortunately not provided in the AJAX response we parse. We could fetch the year of birth from a users profile separely which would add Just FYI, the current behaviour does mimic the original Facebook feature (which did not provide year of birth). Furthermore, the ICS file won't become out of date the following year, each Birthday event repeats yearly. Also this issue should probably be two issues, one for a CSV output feature and the other for including the birthday year. |
Thank you for your quick reply. I had a look into the code and the response in the meantime. I do not yet understand why the script is rather slow, but for yearth of birth I think the way to go is to call https://www.facebook.com/{uid}/about?section=contact_basic for every friend (well, for those friends, that do provide birthdays at all). The code is quite easy to understand (thanks for that) and I consider modifying it myself. if you are interested, I would provide the updated code back to you. |
Please, share! I'd like to have the year as well. |
We can add this in as extra functionality. An extra 2 minutes processing time won't hurt too much I suppose given that most people seem to run this script once. |
Any update for birth year support inside fb2cal? |
Not yet. The same issue exists where fetching the birth year from the users profile would incur a huge performance hit. The script would take many many minutes to run vs only taking a few seconds. We need to find another endpoint that exposes this in bulk but it may not exist. |
Yeah so like I said scraping that page will be very slow and would take 10+ minutes for users with a lot of Facebook friends. Not worth the performance hit. |
With that being said there is some good news! With the new Facebook redesign I see a new endpoint being used to power this page: Looks like its powered via GraphQL at https://www.facebook.com/api/graphql/ for BirthdayCometRootQuery. This should be an even more efficient way to fetch all Birthdays hopefully. |
Update: I looked into this and sadly we don't have the information we need. Facebook uses a REST relay for their public GraphQL endpoint. The endpoint right now returns a data set that looks like this: The recent and upcoming data shows a few recent/upcoming birthdays and these are the ones that have the birthday year. However, making this change is still good because it makes the script much better (because we don't need to deal with locales and languages or any complex calculations). So the change was made here: #81 The ideal solution now I think is adding an optional config setting to also fetch Birthday years manually, one for each Facebook friend. This will be very slow depending on how we do it but at least it will work for those who run this script rarely. |
Good news, a new GraphQL endpoint has been added by Facebook which is identical to the old one but includes the birthday year for all your friends! You can run And this is what it looks like if user has their birth year hidden/private. PR here: #108 CC: @cbncbncnbvb , @hybrid2102 , @VladimirBelov , @bonelifer |
Hey, first of all thank you for your script. It would be nice to have the year of birth as well (if provided by user).
I myself would love a CSV output like
userid,username,birthdate,year_of_birth rather than a ics file which outdates the next year, but thats just me.
The text was updated successfully, but these errors were encountered: