All Projects → cdunklau → fbemissary

cdunklau / fbemissary

Licence: Apache-2.0 license
A bot framework for the Facebook Messenger platform, built on asyncio and aiohttp

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to fbemissary

aiohttp-mako
mako template renderer for aiohttp.web
Stars: ✭ 32 (+6.67%)
Mutual labels:  aiohttp, asyncio
trellio
Python3 asyncio based microframework for microservice architecture
Stars: ✭ 19 (-36.67%)
Mutual labels:  aiohttp, asyncio
Tokio
Asyncio event loop written in Rust language
Stars: ✭ 236 (+686.67%)
Mutual labels:  aiohttp, asyncio
pyladies-courseware
Homework/task submit and review web app · based on React and Python aiohttp
Stars: ✭ 14 (-53.33%)
Mutual labels:  aiohttp, asyncio
python-logi-circle
Python 3.6+ API for Logi Circle cameras
Stars: ✭ 23 (-23.33%)
Mutual labels:  aiohttp, asyncio
Python Mocket
a socket mock framework - for all kinds of socket animals, web-clients included
Stars: ✭ 209 (+596.67%)
Mutual labels:  aiohttp, asyncio
aioneo4j
asyncio client for neo4j
Stars: ✭ 29 (-3.33%)
Mutual labels:  aiohttp, asyncio
Aiohttp Security
auth and permissions for aiohttp
Stars: ✭ 195 (+550%)
Mutual labels:  aiohttp, asyncio
stream video server
demonstrates how to create video streaming server with the help of aiohttp and opencv
Stars: ✭ 15 (-50%)
Mutual labels:  aiohttp, asyncio
pytest-aiohttp
pytest plugin for aiohttp support
Stars: ✭ 110 (+266.67%)
Mutual labels:  aiohttp, asyncio
Create Aio App
The boilerplate for aiohttp. Quick setup for your asynchronous web service.
Stars: ✭ 207 (+590%)
Mutual labels:  aiohttp, asyncio
tomodachi
💻 Microservice library / framework using Python's asyncio event loop with full support for HTTP + WebSockets, AWS SNS+SQS, RabbitMQ / AMQP, middleware, etc. Extendable for GraphQL, protobuf, gRPC, among other technologies.
Stars: ✭ 170 (+466.67%)
Mutual labels:  aiohttp, asyncio
Aiohttp admin
admin interface for aiohttp application http://aiohttp-admin.readthedocs.io
Stars: ✭ 207 (+590%)
Mutual labels:  aiohttp, asyncio
Arsenic
Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Stars: ✭ 209 (+596.67%)
Mutual labels:  aiohttp, asyncio
Aiohttp Devtools
dev tools for aiohttp
Stars: ✭ 202 (+573.33%)
Mutual labels:  aiohttp, asyncio
aioScrapy
基于asyncio与aiohttp的异步协程爬虫框架 欢迎Star
Stars: ✭ 34 (+13.33%)
Mutual labels:  aiohttp, asyncio
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (+533.33%)
Mutual labels:  aiohttp, asyncio
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (+550%)
Mutual labels:  aiohttp, asyncio
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+1176.67%)
Mutual labels:  aiohttp, asyncio
python3-concurrency
Python3爬虫系列的理论验证,首先研究I/O模型,分别用Python实现了blocking I/O、nonblocking I/O、I/O multiplexing各模型下的TCP服务端和客户端。然后,研究同步I/O操作(依序下载、多进程并发、多线程并发)和异步I/O(asyncio)之间的效率差别
Stars: ✭ 49 (+63.33%)
Mutual labels:  aiohttp, asyncio

fbemissary

A bot framework for the Facebook Messenger platform, built on asyncio and aiohttp.

Still very rough.

Example Usage

import sys
import asyncio
import logging
import collections

import aiohttp.web

import fbemissary


logger = logging.getLogger(__name__)


class EchoConversationalist(fbemissary.SerialConversationalist):
    async def event_received(self, event):
        if (
                isinstance(event, fbemissary.ReceivedMessage)
                and event.text is not None
            ):
            logger.debug(
                'Echoing message back to %r',
                self.counterpart_id)
            await self.replier.send_text_message(event.text)
        else:
            logger.warning('Ignoring event {0}'.format(event))


async def start(loop):
    fbmessenger = fbemissary.FacebookPageMessengerBot(
        app_secret='<APP_SECRET>',
        verify_token='<WEBHOOK_VERIFY_TOKEN>')
    factory = fbemissary.ConversationalistFactory(EchoConversationalist)
    fbmessenger.add_conversationalist_factory(
        page_id='<PAGE_ID>',
        page_access_token='<PAGE_ACCESS_TOKEN>',
        conversationalist_factory=factory)
    webapp = aiohttp.web.Application()
    await fbmessenger.start(
        '/webhooks/facebook-messenger',
        webapp.router,
        loop=loop
    )
    server_port = 8080
    server_interface = 'localhost'
    webhandler = webapp.make_handler(loop=loop)
    webserver = await loop.create_server(
        webhandler,
        server_interface,
        server_port,
    )


def main():
    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
    loop = asyncio.get_event_loop()
    loop.create_task(start(loop))
    loop.run_forever()

if __name__ == '__main__':
    main()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].