line is a python library that allow you to send and receive a LINE message. With line you can use LINE on any systems like Ubuntu or make your own LINE bot which will automatically reply for your message!
Enjoy line and May the LINE be with you...
Some codes are removed because of the request of LINE corporation. (2014.08.08)
- login to LINE server
- get a list of contact, group or chat room
- send and receive a message or sticker
- invite, join or leave a group or room
- longPoll method which will allow you to make a LINE bot easily
- Sending a Image
- More usable methods and objects
First, you need to install Apache Thrift. Install instructions are here. (This might take some time...)
$ pip install line
Or, you can use:
$ easy_install line
Or, you can also install manually:
$ git clone git://github.com/carpedm20/line.git $ cd LINE $ python setup.py install
- LINE Episode I: A New Hope
- Known issue
Echo bot example¶
from line import LineClient, LineGroup, LineContact try: client = LineClient("ID", "PASSWORD") #client = LineClient(authToken="AUTHTOKEN") except: print "Login Failed" while True: op_list =  for op in client.longPoll(): op_list.append(op) for op in op_list: sender = op receiver = op message = op msg = message.text receiver.sendMessage("[%s] %s" % (sender.name, msg))
Source codes are distributed under BSD license.