pypi :
kakaotalk module is a python wrapper for LOCO protocol.
You can install this module using pip:
$ pip install kakao
$ easy_install kakao
This project is very much based on the LOCO Analysis from
bpak.org.
Quick Start Guide
Requirement
First of all, you need a KakaoTalk account. Then, you have to find out 'duuid', 'sKey', and 'user_id' for your KakaoTalk account. If you need some help to extract these info from your account, see this post. When you are prepared, you need to specify these info to kakaotalk module. For example:from kakao import kakao kakao.duuid = 'YOUR_DUUID' kakao.sKey = 'YOUR_SKEY' kakao.user_id = 'YOUR_USER_ID'
After you prepared
There are various kinds of commands in LOCO protocol like 'login', 'write', 'read', 'buy', 'checkin' etc. To use these commands freely, you have to follow two steps to make proper connection with LOCO server.- First, send 'checkin' command to get LOCO server info (host and port) to communicate.
document = checkin() host = document['host'] port = document['port']
- Send handshake socket with 'login' command to LOCO server with encryption info.
h = hand() l = login() enc_l = enc_aes(l) command = struct.pack('I',len(enc_l)) + enc_l s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((str(host),port)) s.settimeout(5) s.send(h + command) reply = s.recv(40960)
s = kakao.start() suc = kakao.write(s, chatId, "(하트)")
Commands
buy
: get LOCO server information(HOST,PORT) from KakaoTalkcheckin
: literaly check in to the LOCO servercwrite
: create chat room and send messagewrite
: send message to specific chat roomhand
: handshake command which contains encryption informationlogin
: notify to LOCO server that you will use commands (not sure)chaton
: notify to LOCO server that you will start to chat with specific chat roomnchatlist
: get chat room list from LOCO server (not sure)leave
: leave the specific chat roomping
: send ping to server that notify you are still aliveupseen
: notify that you are checked specific chat roomread
: get chat room list and info from server
댓글 없음:
댓글 쓰기