Giter Site home page Giter Site logo

github_reminder's Introduction

⌈ AZMIAO ⌋

这是一只废物中的战斗废物
- 轻音一生推 -
✨ 下面是京吹置顶图 ✨

京吹

你好呀!这是我的Github首页,它好看吗(不是

欢迎访问我的个人主页哦:轻音时雨

这里会存一些个人写的低水平垃圾代码

我非常的菜,已经菜的不能再菜了

本页面欢迎小伙伴拿去修改使用哦~⭐


滥竽充数的标签:

从 21-08-14 开始统计的访问量:

这是Github访问量,显示不出来可以多刷新几次


github_reminder's People

Contributors

azmiao avatar iona-s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

github_reminder's Issues

'NoneType' object has no attribute 'startswith' occurs when querying a repository

在查仓库时,出现ERROR: 'NoneType' object has no attribute 'startswith'错误

[2021-09-14 13:00:28,522 github_reminder] ERROR: 'NoneType' object has no attribute 'startswith'
Traceback (most recent call last):
  File "/root/HoshinoBot/hoshino/msghandler.py", line 28, in handle_message
    await service_func.func(bot, event)
  File "/root/HoshinoBot/hoshino/modules/github_reminder/__init__.py", line 38, in search_depo
    msg = create_msg(url)
  File "/root/HoshinoBot/hoshino/modules/github_reminder/get_com.py", line 75, in create_msg
    link_list, n = get_commits(html)
  File "/root/HoshinoBot/hoshino/modules/github_reminder/get_com.py", line 32, in get_commits
    if a_lable.string.startswith('from '):
AttributeError: 'NoneType' object has no attribute 'startswith'
[2021-09-14 13:00:28,523 nonebot] INFO: Message 341764145 is ignored: Handled by Hoshino

好像github页面元素又变动导致插件失效了

最近又开始报错了(不清楚是不是个例)
报错内容如下

[2024-01-17 01:50:01,298 github_reminder_poller] ERROR: list index out of range
Traceback (most recent call last):
  File "~\hoshino\service.py", line 344, in wrapper
    ret = await func()
  File "~\hoshino\modules\github_reminder\__init__.py", line 74, in depo_commit_poller
    await poller_update(bot)
  File "~\hoshino\modules\github_reminder\com_poller.py", line 21, in poller_update
    new_time = data_list[0]['time']
IndexError: list index out of range

然后捣鼓了下发现soup.text返回的刚好是json形式的commit历史信息,
整个soup里就只有<html><body><p>commit历史信息的json文本</p/></body></html>
然后便有如下可能不太靠谱的修复
get_com.py 29-41行替换为如下

raw_info = json.loads(soup.text)
commit_infos_by_timeline = raw_info['payload']['commitGroups']
commit_counter = 0  # 记录commit数
for commit_info_by_timeline in commit_infos_by_timeline:
    commit_infos = commit_info_by_timeline['commits']
    for commit_info in commit_infos:
        commit_message = commit_info['shortMessage']
        authors_info = commit_info['authors']
        authors_name = ','.join([info['displayName'] for info in authors_info])
        raw_time = commit_info['committedDate']
        time = await change_time(raw_time)
        data_list.append({'title': commit_message, 'author': authors_name, 'time': time})
        commit_counter += 1
        if commit_counter >= 5:  # 如果要只取最近5次commit
            return data_list

简单测试了下应该没有什么大问题
因为对bs4不太熟悉不清楚为啥只返回了个json文本,但感觉怪怪的,可能用段时间就用不了了
更正经的修复就得重新找页面元素或者直接用github的官方api了

无法“查仓库“

image

我这边走的旁路由,github自动翻墙,访问github是没问题的。

试了下用镜像库也不行
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.