• Stars
    star
    528
  • Rank 81,814 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 11 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

人人网小黄鸡 (deprecated)

此项目已不再维护

我从人人离职后,已不再维护小黄鸡项目,现在线上使用的代码也不再和此仓库一致。

人人网小黄鸡

  • 可以通过在状态里@它或者回复它来交流
  • 依赖的Python库见requirements.txt,可通过 [sudo] pip install -r requirements.txt自动安装
  • 确保本机有redis server且已启动
  • 执行 python rqworker.py 启动rqworker(或者使用 ./workers.sh worker个数 日志目录 来开启), 然后执行 python main.py 启动程序

TODO:

  • 教学模式
  • 自有回复

提交pull request

  • 由于fqj有pep8强迫症,所以在提交之前请先用pep8 (pip install pep8)检查一下代码风格
  • 由于fqj有开源协议强迫症,所以在提交之前'请在文件顶部写上你的copyright信息,并且用中文或英文描述你的变动,同时请注意,你的代码将被以MIT许可证发布,如果你不同意MIT许可证的内容,请再changes中自行加上一个与MIT兼容的其他许可证'。

插件编写

为了方便大家给小黄鸡加入更多有趣的功能,我们引入了插件的方式。

插件放在plugins目录下,每个插件是一个python文件,提供两个接口,testhandle,格式如下:

def test(data, bot):
    // your code

test方法返回TrueFalse,说明是否要用该插件处理这一条请求。

def handle(data, bot):
    // your code

handle方法则实际处理请求,它需要返回一个utf-8编码的字符串,用来作为小黄鸡对这条请求的答复。

data是一个字典,内容如下:

{
    'owner_id'   : 状态主人的id,
    'doing_id'   : 状态的id,
    'message'    : 状态或回复的内容,
    'author_id'  : 回复者的id,   (回复评论的情况)
    'author_name': 回复者的名字,  (回复评论的情况)
    'reply_id'   : 回复的评论的id (回复评论的情况)
}

bot则是一个RenRen的实例

插件编写好之后,请在plugins/__init__.py文件中注册你的插件,具体为在__all__列表里加入一项到你认为合适的位置(插件的匹配是从前往后),但请保证simsimi插件处在列表最后一项。

插件具体例子见plugins目录

插件编写好之后,请在tests目录添加对应的单元测试,具体可参考已有的测试代码,在主目录执行nosetests -v开始测试

More Repositories

1

chatgpt-google-extension

This project is deprecated. Check my new project ChatHub:
TypeScript
13,254
star
2

pick

create curses based interactive selection list in the terminal
Python
636
star
3

beijing_bus

北京实时公交 for Python
Python
375
star
4

lovegift

Love Gift
JavaScript
164
star
5

chatgpt-plugins

Collection of ChatGPT plugins
103
star
6

first-commit

(deprecated) a service to find the first commit of a repo, built with koa.js
HTML
68
star
7

doora

Just another file sharing service
HTML
46
star
8

ifttj

(deprecated) IFTTJ = IFTTT + 即刻
HTML
40
star
9

browser-firewall

Block any extension or website from accessing network
TypeScript
31
star
10

yan.js

颜.js
JavaScript
30
star
11

pmm

PyPi Mirror Manager
Python
29
star
12

pyrenren

RenRen Python Library
Python
28
star
13

memobird.py

unofficial Python SDK for memobird 咕咕机
Python
17
star
14

GrassMudTrojan

病毒课作业,一个简单的木马程序:草泥木马。
Python
16
star
15

kflow

cross platform GUI for k2pdfopt, built with electron
JavaScript
13
star
16

SnowClone

clone of google's "let it snow
JavaScript
10
star
17

PyOthello

An othello game with AI
Python
9
star
18

open163-feed

TypeScript
8
star
19

douban2xiami-chrome

同步豆瓣红心到虾米的Chrome扩展 - 糙!快!猛!
JavaScript
7
star
20

userscripts

some of my userscripts
JavaScript
7
star
21

sse-inspector

JavaScript
6
star
22

FTP4Chrome

FTP Client in Chrome
JavaScript
6
star
23

HUST-Cryptography-Project

密码学课设
C
6
star
24

zhan2weibo

人人小站到新浪微博同步程序
Python
6
star
25

serve-scripts

serve server scripts in browser
JavaScript
6
star
26

HUST-Access-Control-Project

访问控制作业
Python
5
star
27

alipay-qr.com

#WIP
JavaScript
4
star
28

doubanfm.me

未完成
JavaScript
4
star
29

better-extension-manager

管理Chrome扩展的扩展
JavaScript
4
star
30

larus

Larus is a simplified Gunicorn clone
Python
4
star
31

renren-auto-group

人人好友自动分组(k means 聚类)
CoffeeScript
4
star
32

loudness.info

JavaScript
3
star
33

weixin-jssdk-flask

简单的微信 jssdk 服务器端实现 with Flask
Python
3
star
34

atom-flake8

Atom package for flake8
CoffeeScript
3
star
35

rrtm

人人弹幕
JavaScript
3
star
36

dev-in-china

一些开发工具的配置方法,以便在国内愉悦的使用
2
star
37

next-live

2
star
38

nft-api

TypeScript
2
star
39

approved.gg

TypeScript
2
star
40

chathub

2
star
41

request-panel

Chrome extension to add a request panel for Chrome Developer Tools
2
star
42

world-cup-2014-open-data

open data for world cup 2014
2
star
43

batchexecute

TypeScript package to ease interactions with Google's batchexecute batch RPC system
TypeScript
2
star
44

you-are-deleted

Chrome扩展你被删了
JavaScript
2
star
45

is0801

班级通讯录
JavaScript
2
star
46

Save2Weibo

收藏到微博服务
JavaScript
2
star
47

mfers-wallpaper

TypeScript
2
star
48

hardhat-fork-contract

JavaScript
2
star
49

rerss

TypeScript
2
star
50

learngit

test to learn git
1
star
51

ipache

计算机网络作业,简单的Web服务器
C
1
star
52

wong2

1
star
53

renren-visit-shot

人人网来访截图
Python
1
star
54

banzheng-guide

办证指南
1
star
55

placeholder_fixer

Placeholder fallback for browsers don't support it
JavaScript
1
star
56

standby

1
star
57

gen-art-scripts

JavaScript
1
star
58

meowatch

watch fs changes and meow
JavaScript
1
star
59

vimrc

new vimrc file with vundle
Vim Script
1
star
60

hardhat-ui

TypeScript
1
star
61

doc-editor

学习backbone.js
JavaScript
1
star
62

wong2.github.io

https://wong2.me
1
star
63

electron-fetch-via-main

Simple cross origin requests in Electron
TypeScript
1
star