2018-09-16 00:11:02 +00:00
|
|
|
from coroutines.bbj import BBJ
|
2018-09-16 01:27:56 +00:00
|
|
|
from coroutines.rss import RSS
|
2018-09-16 00:11:02 +00:00
|
|
|
|
|
|
|
# {
|
|
|
|
# "worker": test,
|
|
|
|
# "interval": 3
|
|
|
|
# }
|
|
|
|
# def test(bot):
|
|
|
|
# print("Testing {}".format(bot.botnick))
|
|
|
|
|
2018-11-24 03:10:10 +00:00
|
|
|
def use(cls):
|
|
|
|
return lambda state: cls(state).start()
|
|
|
|
|
2018-09-16 00:11:02 +00:00
|
|
|
coroutines = [
|
|
|
|
{
|
2018-11-24 03:10:10 +00:00
|
|
|
"worker": use(BBJ),
|
2018-09-16 00:11:02 +00:00
|
|
|
"interval": 5,
|
|
|
|
"state": {
|
2018-09-16 01:27:56 +00:00
|
|
|
"alias": "bbj",
|
2018-09-16 00:11:02 +00:00
|
|
|
"source": "http://localhost:7099/api",
|
2018-09-16 04:27:38 +00:00
|
|
|
"channels": ["#team"]
|
2018-09-16 01:27:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2018-11-24 03:10:10 +00:00
|
|
|
"worker": use(RSS),
|
2018-09-16 01:27:56 +00:00
|
|
|
"interval": 6,
|
|
|
|
"state": {
|
2019-01-11 20:56:56 +00:00
|
|
|
"alias": "links",
|
2018-09-16 01:27:56 +00:00
|
|
|
"source": "https://tilde.news/newest.rss",
|
|
|
|
"use": "title",
|
2018-09-16 04:27:38 +00:00
|
|
|
"channels": ["#meta", "#tildeverse"]
|
2018-09-16 01:27:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2018-11-24 03:10:10 +00:00
|
|
|
"worker": use(RSS),
|
2018-09-16 01:27:56 +00:00
|
|
|
"interval": 8,
|
|
|
|
"state": {
|
|
|
|
"alias": "links-comments",
|
|
|
|
"source": "https://tilde.news/comments.rss",
|
2018-09-26 17:58:30 +00:00
|
|
|
"use": "description",
|
2018-09-16 04:27:38 +00:00
|
|
|
"channels": ["#tildeverse"]
|
2018-09-16 00:11:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|