Giter VIP home page Giter VIP logo

vk-to-telegram-bot's Introduction

⚠️ Current code is a little but outdated, but it could still work ⚠️


⬇️⬇️⬇️👇⬇️⬇️⬇️

🆕 CHECK THIS NEW VERSION: 🆕

⬆️⬆️⬆️👆⬆️⬆️⬆️


VK to Telegram auto-posting Bot

Info

  • Bot-manager for auto-reposting posts from VK user/group/public to Telegram channel

Variations of posting

  • one VK source -> one Telegram channel
  • one VK source -> few Telegram channels
  • few VK sources -> one Telegram channel
  • few VK sources -> few Telegram channels

For examples of configuration check docs

Links

Features

  • One script for many Telegram Bots, Telegram Channels, VK sources
  • Resend posts from users and groups
  • Resend text and photos
  • Few variations of behaviour
  • Flexible settings
  • Simple i18n

Features to release

this will be implemented soon

  • resend all attachment types
  • test coverage
  • variations of data storage(database, json, etc)

Documentation

Examples of channels with this bot

Telegram Channel VK
Hackathon list Hackathon list
Frontend Raccoon Frontend Raccoon

Links and Copyrights:

vk-to-telegram-bot's People

Contributors

andrychuyko avatar dependabot[bot] avatar lgg avatar megastruktur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vk-to-telegram-bot's Issues

Is this project alive?

Hey @lgg! First of all thank you for this, it's an incredibly useful little software.
Are you going to continue development of it? I've noticed you had quite a plan for it, and I'm personally missing a few features.
Are you going to go on with the development, or should I fork it?
Thanks!

file_get_contents_curl

for hosting without extension=openssl.so ->
use this function instead of file_get_contents in class VkApi

function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}

refactor all docs

  • add simple description of bot modes
  • add simple docs for bot Configs and settings
  • add examples

Вставка несколько групп (так же подписи под постом) + постинг с закрытых групп?

Добрый, не до конца понял как правильно вставлять несколько групп в конфиге. Сработал способ лишь, вставка еще одного массива в классе configs (ибо в вашей документации не нашел описания).

И если работает вставки массива и в этом массиве можно изменять, грубо говоря параметры каждой группы, то нет ли параметра вставки подписи группы под постом? К примеру:

{
“Пост”
Сообщение от - “группы A”

“Пост”
Сообщение от - “группы B”

“Пост”
Сообщение от - “группы C”
}

Помощь в документации (не запускается бот).

В общем вроде бы сделал все условия. Но посты так в телеги и не появляются…

//VK
"vk" => "-173697340",
"vk_token" => "a1607949a1607949a13526fb9ba1068d75aa160a1607949fa875bdbafd25745c795****",
//Telegram
"t_key" => "719183816:AAE-vmYDZGNSJmRnycMCUchBq4MJQV6j0mc",
"t_name" => "test_not_euppi98_1_bot",
"t_chat" => "test_1_euppi98",

Хостинг использую mchost.ru
Сам домен - https://signal-exchange.mcdir.ru
Планировщик:
screen shot 2018-11-10 at 22 16 31
От планировщика по почте получаю вот такой ответ:
/bin/sh: /home/httpd/vhosts/signal-exchange.mcdir.ru/httpdocs/vk-to-telegram-bot: is a directory

fix reposts view

Add few types for reposts:

  1. only repost
  2. repost reaction + repost link

Бесконечные публикации

Привет!
Бот почему то постоянно берет последний пост и публикует его в канале. Через заданный промежуток времени снова берет этот же рост и публикует его. Как исправить?
В коде ничего не менял, кроме версии api vk и настроек естественно.

attachments parse and resend

relative to #3, #4, #5, #6

  • check how photo resend is realized now
  • check if we can get video source link(youtube, vimeo, etc)
  • check if we can get original link to VK video
  • check how VK video is parsed in Telegram
  • decide what to do with audio(other services(youtube audio, etc), send only text name of the song)
  • decide how to resend documents

Add check and error log for directory permissions

[22-Jul-2018 20:46:01 UTC] PHP Warning:  file_put_contents(/last.json): failed to open stream: Permission denied in /home/x------ml/console/vk-to-telegram-bot/app/Manager.php on line 42
[22-Jul-2018 20:46:01 UTC] PHP Warning:  file_get_contents(/last.json): failed to open stream: No such file or directory in /home/x-----ml/console/vk-to-telegram-bot/app/Manager.php on line 46
[22-Jul-2018 20:46:01 UTC] PHP Warning:  file_put_contents(/log.txt): failed to open stream: Permission denied in /home/x-----ml/console/vk-to-telegram-bot/app/Log.php on line 12

Не получается побороть ошибки. Все делал по инструкции.

fix dots and string cut

image

  1. Don't cut words (as on screen), cut only spaces after word

    • on screen dots are not needed
  2. Decide cutting letters limit (3 or less?) e.g. hell...(hello) - won't be cut. transa...(transaction) - will be cut

Video attach support in manager

please add simple video attach support in class Manager

      _if ($attach["type"] == "photo") {
                            $telegram->sendPhoto(VkApi::findMaxSizeLink($attach["photo"]));
                        } elseif ($attach["type"] == "link" && isset($attach["link"]["photo"])) {
                            $telegram->sendPhoto(VkApi::findMaxSizeLink($attach["link"]["photo"]));
                        } elseif ($attach["type"] == "doc" && isset($attach["doc"]["preview"]["video"])) {
                           $telegram->sendGIF($attach["doc"]["preview"]["video"]['src']);
                        } elseif ($attach["type"] == "video" && isset($attach["video"]["photo_320"])) {
                           $telegram->sendPhoto(VkApi::findMaxSizeLink($attach["video"]));
                        }_

refactor all code

  • close #17
  • change logic of Config class and Config loading
  • clear code
  • add ability for i18n

2.1 roadmap

VK Parsing

  • resend or notify about polls
  • info about author of post

Docs and code

  • add more comments to code

Other

  • add tests

add post editing

Few options:

  • post monitoring is off
  • post monitoring is on
    • delete post if original is deleted or not

When on:

  • watch for VK post for changes
  • edit telegram post

2.0 roadmap

Common

  • Use MongoDB for storing posts history
  • Add VK repost support
  • Config/Settings update, simplify settings
  • Update logging system
  • clear code

VK repost support

  • Add few types for reposts: only repost | repost reaction + repost link | All repost content
  • Use 'reply_to' telegram method. (original post from another source -> reply 1(as reply to previous) -> reply 2(as reply to previous))

Settings/Config update

  • Add simple posting to one channel from few VK sources(check #32)
  • Add simple posting to few channels from one VK source
  • change logic of Config class and Config loading
  • add parameters value by default
  • add support for same values for parameters in Config(e.g. same VK_token for few configs)

Logging system

  • add logs when have bad bot credentials
  • refactor logging system

VK Parsing

  • exclude ads from reposting(add check for "ads" posts, turn off posts with reposts)
  • use vk.cc links for internal VK links(e.g. profiles, groups etc)
  • add ability to set mask for internal VK links
  • add 'is_pinned' checking
  • resend video
  • resend audio
  • resend documents
  • check how photo resend is realized now
  • check if we can get video source link(youtube, vimeo, etc)
  • check if we can get original link to VK video
  • check how VK video is parsed in Telegram(with VK auth/ w/o VK auth)
  • decide what to do with audio(other services(youtube audio, etc), send only text name of the song)
  • decide how to resend documents(exploit attention) (test with/o VK auth) maybe send link to VK doc

Telegram API

  • update deps
  • Post editing(manually and auto) - check if VK Post Changed - update Telegram Text + check #11
  • Ability to delete message if it deleted from VK
  • Pin message support

Docs

  • Requirements(php -v, other) + add info about compatible php version
  • Installation guide
  • Configuration guide
  • fix phpDOC description(fix existing phpDoc, add phpDoc for all)
  • add examples for docs for each configuration
  • rewrite docs for each param
  • refactor all docs
  • update copyright and license(no commercial use)

Other

  • cli tool for manually parsing VK and posting to Telegram(with and w/o writing to DB) + manually repost from VK to Telegram by url
  • ability to sync all VK posts to Telegram
  • ability to clear DB for specific post

Не пересылаются прикрепленные изобрадения

Вот конфиг

        "messageSend" => [
            "disable_web_page_preview" => true,
            "disable_notification" => false
        ],
        //Bot-manager settings
        //Bot-manager reposting params(modes)
        "extended" => [
            "active" => true,
            "needLink" => true,
            "resendAttachments" => true,
        ],
        "needPostPreview" => true,
        //Bot-manager internal functions params
        "language" => "ru",
        "textCutter" => [
            "aggressive" => false,
            "limit" => 3
        ],
        "vkLinks" => [
            "show" => false,
            "symbols" => [
                "open" => "[",
                "close" => "]"
            ]
        ]

Вот пост https://vk.com/russmoroz?w=wall438401560_34194
В телеграм пришел только текст

add id checking

add id check:
if post id = 0 or -1 - do nothing

it needed to prevent bot from VK api wrong response or deleted posts.

В телеграм-группу пересылаются только изображения

Здравствуйте. В телеграм-группу из группы в ВК пересылаются только изображения. Текст, который прикреплен к посту в ВК, не пересылается, какие бы настройки я не выставлял в конфиге. Использую следующий файл конфига:

private static $configs = [
        [
            //VK
            "vk" => "-86706093",
            "vk_token" => "bef***********de3",
            //Telegram
            "t_key" => "6df*******fer",
            "t_name" => "dogzone_testbot",
            "t_chat" => "dog_zone",
            "messageSend" => [
                "disable_web_page_preview" => false,
                "disable_notification" => false
            ],
            //Bot-manager settings
            //Bot-manager reposting params(modes)
            "extended" => [
                "active" => true,
                "needLinkToVKPost" => true,
                "needFromText" => [
                    "withLink" => true,
                    "prepend" => true,
                    "customName" => "Потеряшки Гомель"
                ],
                "resendAttachments" => true,
            ],
            "needPostPreview" => ignored,
            //Bot-manager internal functions params
            "language" => "ru",
            "textManager" => [
                "aggressive" => true,
                "limit" => 3
            ],
            "vkLinks" => [
                "show" => true,
                "symbols" => [
                    "open" => "[",
                    "close" => "]"
                ]
            ]
        ],
    ];

Группа в ВК vk.com/club86706093, телеграм-группа: t.me/dog_zone.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.