Giter VIP home page Giter VIP logo

pykakao's Introduction

pykakao

pykakao is a simple kakaotalk LOCO/HTTP API protocol wrapper for python.

! warning: cannot get new session_key anymore.

Installation

Install it using setup.py.

python setup.py install

If you are using Windows, you need to install PyCrypto manually.

To install PyCrypto manually, follow these steps.

  • Download zip archive.
  • Unzip it in Python's site-packages directory(Ex. C:\Python27\Lib\site-packages or /Library/Python/2.7).

Example Codes

  1. How to get session key and user id
from pykakao import kakaotalk

kakao = kakaotalk()
if kakao.auth("EMAIL", "PASSWORD", "COMPUTER NAME", "DEVICE ID"):
    # computer name and device id are not important things. you can pass any string you want.
    print kakao.session_key
    print kakao.user_id
else:
    print "auth failed."
  1. A Simple echoing bot
from pykakao import kakaotalk

kakao = kakaotalk("SESSION KEY", "DEVICE ID", USER ID)
if kakao.login():
    while True:
        packet = kakao.translate_response()
        
        if not packet:
            print "connection closed."

        if packet["command"] == "MSG":
            if packet["body"]["chatLog"]["authorId"] != kakao.user_id:
                kakao.write(packet["body"]["chatLog"]["chatId"], packet["body"]["chatLog"]["message"])
else:
    print "login failed."

License

pykakao is following MIT License.

Thanks To

Cai(0x90 :: Cai's Blog)

pykakao's People

Contributors

hallazzang avatar ssut avatar su79eu7k avatar dittos avatar grraffe avatar

Watchers

James Cloos 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.