mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-04 02:26:11 +08:00
support wechat
This commit is contained in:
parent
ed163cc842
commit
d56c608dd7
@ -45,7 +45,8 @@ class Wechat(Platform):
|
||||
post = {
|
||||
'title': last_post_dt.find_parent().find('a').text,
|
||||
'target': target,
|
||||
'page_url': self._get_query_url(target)
|
||||
'page_url': self._get_query_url(target),
|
||||
'name': block.find('p', class_='tit').find('a').text
|
||||
}
|
||||
return [post]
|
||||
else:
|
||||
@ -67,6 +68,7 @@ class Wechat(Platform):
|
||||
# TODO get content of post
|
||||
return Post(target_type='wechat',
|
||||
text='{}\n详细内容请自行查看公众号'.format(raw_post['title']),
|
||||
target_name=raw_post['name'],
|
||||
pics=[],
|
||||
url=''
|
||||
)
|
||||
|
@ -18,6 +18,11 @@ async def bilibili_check():
|
||||
async def rss_check():
|
||||
await fetch_and_send('rss')
|
||||
|
||||
|
||||
@scheduler.scheduled_job('interval', seconds=30)
|
||||
async def wechat_check():
|
||||
await fetch_and_send('wechat')
|
||||
|
||||
@scheduler.scheduled_job('interval', seconds=1)
|
||||
async def _():
|
||||
await do_send_msgs()
|
||||
|
@ -20,7 +20,7 @@ class Singleton(type):
|
||||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
|
||||
return cls._instances[cls]
|
||||
|
||||
supported_target_type = ('weibo', 'bilibili', 'rss')
|
||||
supported_target_type = ('weibo', 'bilibili', 'rss', 'wechat')
|
||||
|
||||
if not plugin_config.hk_reporter_use_local and not check_chromium():
|
||||
os.environ['PYPPETEER_DOWNLOAD_HOST'] = 'http://npm.taobao.org/mirrors'
|
||||
|
Loading…
x
Reference in New Issue
Block a user