We combine twitter.com and vkontakte.ru (php version)

    Inspired by the post http://habrahabr.ru/blogs/python/59236/ .
    After reading the above post, I suggested that not everyone can use a home computer for such purposes (for example, because it is not always on). But many of us have php hosting, which also supports cron. To warm up, I wrote this script.

    When writing used:
    twitter API, which downloaded here
    vkontakte API, which he wrote himself. Script code has turned out such: Total to pour it into a folder on your hosting account to register the settings in the config.php file that has the following in mind: . And basically the script is ready to use. I apologize for the "undocumentation" of my code, I think everything is clear here, but still I will document a little free time. I accept questions and suggestions for the development of the script. And also possible bugs that I will try to edit as soon as possible. The full archive with the API can be downloaded here: www.radmus.net/downloads/twitter2vkontakte.zip Enjoy using! =)

    include 'twitter.class.php';
    include 'vkontakte.class.php';
    include 'config.php';

    $twitter = new twitter();

    $twitter->username = $twitterUser;
    $twitter->password = $twitterPassword;

    $statusTwitter = $twitter->userTimeline()->status->text;

    $vk = new VkontakteAPI($vkontakteEmail, $vkontaktePassword);

    $statusVkontakte = $vk->getStatus();

    if ($statusTwitter != $statusVkontakte)

    $twitterUser = 'pupkin';
    $twitterPassword = 'temp';

    $vkontakteEmail = 'pupkin@yandex.ru';
    $vkontaktePassword = 'temp';

    Also popular now: