Skip to main content

Between of VCNC for Python

Project description

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:
                        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)

Screenshot

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

Authors

Taehoon Kim / @carpedm20

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

between-0.2.7.tar.gz (20.7 kB view details)

Uploaded Source

File details

Details for the file between-0.2.7.tar.gz.

File metadata

  • Download URL: between-0.2.7.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for between-0.2.7.tar.gz
Algorithm Hash digest
SHA256 f854da752db792c575fb23f93a4374987a6d3a47e2e515067f3076dc5e99c7f8
MD5 256ba26e19197a667a06ca30aadbca02
BLAKE2b-256 5b48ccc3c44f45c27e3b9c65235e9bb2e2784f15fa3a3c477752534b2f93e4fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page