레이블이 카카오톡인 게시물을 표시합니다. 모든 게시물 표시
레이블이 카카오톡인 게시물을 표시합니다. 모든 게시물 표시

2013년 10월 17일 목요일

2013년 8월 18일 일요일

[카카오톡] python wrapper for LOCO protocol


pypi : https://pypi.python.org/pypi/kakao

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.
  1. First, send 'checkin' command to get LOCO server info (host and port) to communicate.
    document = checkin()
    
    host = document['host']
    port = document['port']
    
  2. 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)
    
Instead of using those codes, you can just simply use start() function :) For example:
s = kakao.start()
suc = kakao.write(s, chatId, "(하트)")

Commands

  • buy : get LOCO server information(HOST,PORT) from KakaoTalk
  • checkin : literaly check in to the LOCO server
  • cwrite : create chat room and send message
  • write : send message to specific chat room
  • hand : handshake command which contains encryption information
  • login : 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 room
  • nchatlist : get chat room list from LOCO server (not sure)
  • leave : leave the specific chat room
  • ping : send ping to server that notify you are still alive
  • upseen : notify that you are checked specific chat room
  • read : get chat room list and info from server
Application

HeXA bot

License Information

The MIT License (MIT)
Copyright (c) 2013 Kim Tae Hoon

2013년 8월 6일 화요일

[카카오톡] 헥사봇


* 2014.01.13 Announcement *

The End :)



* 2013.12.12 Announcement *


'carpedm20'으로 검색이 허용되지 않는것으로 보입니다.

현재로서는 지인을 통해 친구 추가하시는 방법밖에 없어 보입니다.

It is not possible to search HeXA Bot with 'carpedm20'.

The only way to make HeXA Bot as your friend is getting some help from your friends.



HeXA Bot is a robot which automatically answer to user's command through KakaoTalk.

Facebook : https://www.facebook.com/photo.php?fbid=468189449939384
HeXA : http://hexa.us.to/

Analysis of LOCO protocol : http://carpedm20.blogspot.kr/2013/07/loco.html

ps. https://pypi.python.org/pypi/kakaotalk
ps2. pip install kakaotalk