Export birthdays from VKontakte (work with OpenAPI)

    imagePersonally, I am not a fan of social networks, and especially VKontakte, because of which I had a lot of time wasted. Actually, therefore, at one time I decided to leave it. But at some point, I realized that the contact was not only a place where you could press F5 on the News page for communication from morning to night , but also a service, thanks to which I could in time learn about my friends' birthdays and, thus, support with they have a good relationship.

    Thus, the task was set: export the calendar to an external service (in my case, Google Calendar). The native API is used, so everything works quickly and without bugs. Who cares - I ask for a cat.

    So, the following options were considered:

    An option in the forehead is to write a script that collects answers to the AJAX requests of the calendar page. In general, bypassing security problems, half an hour over the Firebug server responses, creating php-files - and you get a file with formatted HTML blocks, from which you also need to calculate the year of birth from age in brackets, and of course, even HTML is not very valid. The option has disappeared. Work went on, and there was no time + desire to look for other options.

    Soon on Habré the article "Export of Birthdays from VKontakte to Google Calendar" appeared, which offered a similar solution, only in the form of a user script, with jQuery shoved inside. Well, I thought, what slows down is not very scary, the main thing is that it works. Unfortunately, a couple of unpleasant bugs were discovered (including problems with special characters in names, a limit of one person per day), and this option also disappeared.

    Yesterday, from reluctance to do anything useful, I decided to return to the question. Since at this moment the contact already has a more or less normal API for external sites and js applications ( OpenAPI), it was decided to use it. A couple of hours of proceedings, regret that there is no analogue of FQL or social graph, then disassembly with the iCalendar format - and, thus, the simplest HTML file and contact application (so as not to load the server) were created that allow you to get ics- file for subsequent import into any popular calendar program.

    You can familiarize yourself and download the "page" here: http://pastebin.com/Q4dwGQyL
    If you are too lazy to create your VKontakte application and just want to use the ready-made solution, you can try here: http://rreverser.com/dev/vkcal.htm (I warn you , hosting is free, so it may not withstand the famous effect).

    Method of use:
    • Click the VKontakte login button
    • Allow access
    • Wait until the code appears in textarea
    • Press one of the “Save ...” buttons or save the received code in the ICS file manually
    • Import the saved file into the calendar (Google Calendar, Outlook, etc.)
    Thanks, bye for now.

    Note : the script is written by my friend RReverser.

    Also popular now: