All Projects → ciricc → easyvk

ciricc / easyvk

Licence: MIT license
This app helps you create an apps with vk api easy!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to easyvk

Vk Requests
vk.com requests for humans. API library for vk.com
Stars: ✭ 162 (+67.01%)
Mutual labels:  vk, streaming-api, vk-api
Node Vk Bot Api
🤖 VK bot framework for Node.js, based on Bots Long Poll API and Callback API.
Stars: ✭ 195 (+101.03%)
Mutual labels:  vk, vk-api
Vk Api Schema
JSON Schema of VK API
Stars: ✭ 158 (+62.89%)
Mutual labels:  vk, vk-api
Swiftyvk
Easy and powerful way to interact with VK API for iOS and macOS
Stars: ✭ 247 (+154.64%)
Mutual labels:  vk, vk-api
Vk To Telegram Bot
Bot for auto-reposting posts from VK to Telegram channel
Stars: ✭ 103 (+6.19%)
Mutual labels:  vk, vk-api
Sketal
Бот для ВКонтакте. Беседы / группы / развлечения.
Stars: ✭ 119 (+22.68%)
Mutual labels:  vk, vk-api
Vkbottle
Homogenic! Customizable asynchronous VK API framework
Stars: ✭ 191 (+96.91%)
Mutual labels:  vk, vk-api
py-vkontakte
A Python wrapper around the vk.com
Stars: ✭ 17 (-82.47%)
Mutual labels:  vk, vk-api
vk-chat-bot
📦 node package for building chat bots for VK communities (uses Callback API)
Stars: ✭ 21 (-78.35%)
Mutual labels:  vk, callback-api
VideoforVk
Video for Vk (or VT) is client for Vk video API.
Stars: ✭ 27 (-72.16%)
Mutual labels:  vk, vk-api
Whom I Know
Looks for common users of vk.com [DEPRECATED]
Stars: ✭ 69 (-28.87%)
Mutual labels:  vk, vk-api
vkbottle
Сustomizable asynchronous VK API framework
Stars: ✭ 371 (+282.47%)
Mutual labels:  vk, vk-api
Vkrss
Generates RSS feed of opened/closed vk.com wall or global searched opened posts. Features: post filtering (include/exclude by regexp and/or by owner type), ads skipping, automatic title generation, hash-tags extraction as RSS categories, initial author extraction, HTML formatting
Stars: ✭ 59 (-39.18%)
Mutual labels:  vk, vk-api
Vkwave
Asynchronous framework for building high-performance & easy to scale projects interacting with VK's API.
Stars: ✭ 135 (+39.18%)
Mutual labels:  vk, vk-api
Vk api
Модуль для создания скриптов для ВКонтакте | vk.com API wrapper
Stars: ✭ 1,070 (+1003.09%)
Mutual labels:  vk, vk-api
Vk.py
Extremely-fast, easy-to-use, [not] ready for production. The asyncio based library for Python and Humans written to be efficient and reliable. [Unmaintained]
Stars: ✭ 38 (-60.82%)
Mutual labels:  vk, vk-api
Vk Io
Modern VK API SDK for Node.js
Stars: ✭ 401 (+313.4%)
Mutual labels:  vk, vk-api
Vkb
Bot for vk.com competitions
Stars: ✭ 24 (-75.26%)
Mutual labels:  vk, vk-api
vk-api
VK SDK | VKontakte wrapper for standalone apps
Stars: ✭ 30 (-69.07%)
Mutual labels:  vk, vk-api
java-vk-bots-long-poll-api
A Java library to create VK bots using Bots Long Poll API
Stars: ✭ 30 (-69.07%)
Mutual labels:  vk-api, longpoll

EasyVK logo

EasyVK (VKontakte API Manager) v2.0 (DEPRECATED)

This package has been deprecated and will no longer be supported.

This library helps you easily create a javascript application with VKontakte API! Official VK API: vk.com/dev/

Codacy Badge Build Status Downloads Issues Node version support Npm version released

Community Документация на русском

Для русскоязычных

Данная библиотека создана для того, чтобы VKontakte API имел удобную поддержу на node.js. С помощью этой библиотеки вы можете делать все, что позволяет официально ВКонтакте API, и не только. Так как я предполагаю, что большинство людей, кто скачивает - владеют русским с рождения, то я написал документацию для этого модуля на этом языке. Если вы хотите помочь в развитии этой библиотеки, вступайте в наше сообщество и предлагайте, что можно улучшить и добавить. Если вы хотите помочь нам кодом - делайте это на github. Ниже написано, что можно делать при помощи EasyVK.

Installing

Download and install Node.js. Create a project and install easyvk with npm:

npm i easyvk --save

Yarn installation

If you are using a yarn package manager, you can add easyvk to project so

yarn add easyvk

Example usage

You can test the library without installing on npm runkit. Copy this code and paste it in the code area, don't forget to change username and password.

const easyvk = require("easyvk")

//Authenticating user
easyvk({
   username: 'your_login',
   password: 'your_password',
   save: false,

   // By default are vk android credentials 
   clientId: 'YOUR_CLIENT_ID',
   clientSecret: 'YOUR_CLIENT_SECRET'
}).then(vk => {
  
   //Getting user id from authenticated session
   let me = vk.session.user_id || 356607530 //Or your account id
   
   //Sending a message using messages.send method
   vk.call('messages.send', {
      message: 'Hi',
      user_id: me,
      random_id: easyvk.randomId()
   }).then((vkr) => console.log(vkr))
   
}).catch(console.error)

EasyVK can help you

  • Create Bots
  • Manage groups
  • Use LongPoll: Bots LongPoll (groups) and User LongPoll
  • Create high loading projects with highload mode
  • Use Callback API (like creating your server to listen to group events)
  • Manage your stream based on official Streaming API, listen to events and collect data to create statistic and metrics
  • Upload your files to the server
  • Call official VKontakte API methods
  • Use my widgets - non-official instruments for everyday tasks
  • Use helpers - utility for creating something that you need everyday
  • Use saved session, cache data to saved session
  • Catch errors like Captcha error and others
  • Configure all that you want or not (utils can bee disabled or enabled by you)

EasyVK provide

  • Promises and async / await based library
  • Authentication support: groups, users, applications, password + username
  • Informative documentation
  • Regular updates and support for newest features
  • Two factor authentication support
  • Easy working with captcha errors and captcha handlers
  • Easy customize your requests and easy control them

You can read documentation here

Что дает EasyVK

Узнайте, зачем Вам может понадобиться Easy VK, и что именно он может вам дать!

Режим параллельных запросов

В Easy VK есть режим highload, включая который, вы сможете использовать все возможности API ВКонтакте даже при большом количестве запросов. Этот режим дает знать библиотеке, что все запросы необходимо выполнять через метод execute, который выполняет до 25 запросов в секунду.

Может пригодиться чат-ботам, в которых сообщений в тысячи раз больше, чем пользователей.

easyvk({
  token: "{GROUP_TOKEN}",
  reauth: true,
  mode: 'highload' || {
    timeout: 10,
    name: 'highload'
  }
}).then(async (vk) => {
  
  let connection = await vk.bots.longpoll.connect();

  connection.on('message_new', console.log);

});

Плагины

Теперь в Easy VK будет поддерживаться разработка новых плагинов. Функционал API для плагинов будет дополняться по мере просьб и нужд разработчиков, я всегда буду рад обновлениям.

  
  // Разработка простейшего плагина для отправки сообщений
  vk.use(async ({thread, next}) => {
    if (thread.method == "messages.send") {
      // Автоматически меняем типа запроса на POST
      thread.methodType = "post";

      if (Number(thread.query.v) >= 5.90) {

        /* Для новых версий API ВКонтакте для сообщений 
           требует поля random_id (уникальный id сообщения) */
        thread.query.random_id = easyvk.randomId(); 
      }

    }

    // Запускаем следующий плагин
    await next();
  });

Client Credentials Flow и авторизация по приложению

  easyvk({
    clientId: '{APP_SECRET_CODE}',
    clientSecret: '{CLIENT_SECRET_CODE}',
    utils: {
      streamingAPI: true
    }
  }).then((vk) => {

    const StreamingAPI = vk.streamingAPI

    return StreamingAPI.connect().then((connection) => {

      connection.getRules().then((vkr) => {
        console.log(vkr.rules);
      });
      
      connection.on("post", console.log);

    });
  });

LongPoll API

Создавайте своих чат-ботов с помощью Easy VK и его возможностей LongPoll API

  
  //bots
  vk.bots.longpoll.connect({
    forGetLongPollServer: {
      grop_id: vk.session.group_id
    }
  }).then((connection) => {
    
    connection.on("message_new", (msg) => {
      
      //On message event
      vk.call("messages.send", {
        peer_id: msg.from_id,
        message: "Reply it!",
        random_id: easyvk.randomId()
      }).catch(console.error);

    });

  });

  //user longpoll
  vk.longpoll.connect({}).then((connection) => {
    connection.on("message", (event) => {
      console.log(event);
    });
  
    //changed state of message
    connection.addEventCodeListener(3, (eventChangeState) => {
      console.log(eventChangeState);
    });
  });

Streaming API

Собирайте статистические данные о популярности тех или инных продуктов, проектов - чего угодно! Это позволит Вам знать, о чем пишут пользователи ВКонтакте, и кто из них - ваши клиенты!

    
  easyvk({
    clientId: '{APP_SECRET_CODE}',
    clientSecret: '{CLIENT_SECRET_CODE}',
    utils: {
      streamingAPI: true
    }
  }).then(vk => {
    vk.streamingAPI.connect((stream) => {
        
      stream.initRules({
        key1: 'кошка',
        key2: 'собака -кот'
      }).then((changes) => {
        
        console.log(changes.changedRules, changes.deletedRules, changes.addedRules);

        stream.on("post", (postEvent) => {
          console.log("Post info: ", postEvent);
        });
        
        //.on(...)
        //.on("share")
        //.on("comment") etc...
      });

    });
  })

Callback API

Создавайте чат-ботов (и не только) с помощью Callback API, имея собственный сервер с открытым доступом в интернете.

  easyvk.callbackAPI.listen({
    port: process.env.PORT || 8080,
    groups: [
      {
        groupId: 11,
        confirmCode: 'TestConfirmationCode',
        secret: 'GroupPassword'
      },
      {
        /*....*/
      }
    ]
  }).then((connection) => {
    
    connection.on('message_new', (msg) => {
        console.log(msg.group_id);
    });

  }).catch(console.error);

Все остальное находится на сайте-документации проекта.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].