Giter Club home page Giter Club logo

between's Introduction

between

https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/p200x200/10517518_750265521675300_788817894578396496_n.png?oh=7ca341ef155d138a5a44367e2ea16352&oe=55CBB403&__gda__=1438880194_5cb73422083338e6855db51023441766

Between of VCNC for Python.

How to be loved? This is the answer for your question.

How to use

  1. Date with somebody
  2. Install Between
  3. Write a fun bot
  4. Be loved by your lover

Installation

Simple.

$ pip install between

Example

Simple commands:

import between

client = between.Client("YOUR_ID", "YOUR_PASSWORD")
client.send("Carpe diem!")
client.send_sticker()
client.send_sticker("85_12")
client.send_image("./test.jpg")
print client.get_recent_messages()

Simple bot:

import between

def on_message(ws, message):
   print message

def on_open(ws):
   ws.send("Hello World!")

bot = between.Bot("YOUR_ID", "YOUR_PASSWORD", on_open=on_open, on_message=on_message)
bot.run_forever()

Echo bot:

import between

client = between.Client("YOUR_ID", "YOUR_PASSWORD")

me = client.me.account_id
lover = client.lover.account_id

def on_message(ws, message):
   print message

   if message.has_key('p'):
      if message['p'] == 'events':
            for event in message['m']['events']:
               if event['action'] == 'EA_ADD':
                  msg = event['messageEvent']['message']

                  if msg['from'] != me: # this will not work.. see issue #3
                        if msg.has_key('attachments'):
                           attachment = msg['attachments'][0]

                           if attachment.has_key('reference'):
                              # echo image
                              ws.send_image(image_id=attachment['reference'])

                           elif attachment.has_key('sticker'):
                              # echo sticker
                              ws.send_sticker(attachment['sticker']['sticker_id'])
                        elif msg.has_key('content'):
                           # echo message
                           ws.send(msg['content'])

bot = between.Bot(client=client, on_message=on_message)
bot.run_forever()

Features

  • Login and authentication
  • Send a message
  • Send a sticker
  • Send an image
  • Get recent messages
  • Message long polling
  • Get uploaded image lists (in progress)
  • This work is not connected with VCNC Corporation

Screenshot

https://raw.githubusercontent.com/carpedm20/between/master/contents/demo.png

Authors

Taehoon Kim / @carpedm20

between's People

Contributors

carpedm20 avatar

Watchers

James Cloos avatar Woonki Jeon avatar

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.