webhook

package module
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: MIT Imports: 4 Imported by: 0

README

webhook

webhook

✨ 你说得对,但是 webhook 是基于 weibo-webhook 改良的分布式博文收集终端 ✨

文档 · 下载

使用

下面是一个简易的提交脚本 ~(∠・ω< )

需要安装前置库 post-submitter (Github)

pip install post-submitter
from loguru import logger

from submitter import Submitter, Weibo

URL = "http://localhost:9000"
TOKEN = "********"
UID = "188888131"
PostList = []


@Submitter(url=URL, token=TOKEN, dedeuserid=UID)
async def _(sub: Submitter):
    wb = Weibo()
    @sub.job(interval=5, uid=7198559139)
    async def _(uid: int):
        async for post in wb.posts(uid):
            if post.mid not in PostList:
                PostList.append(post.mid)
                logger.info(post)
                err = await sub.submit(post)
                if err is not None:
                    logger.error(err)
                else:
                    logger.info("提交成功")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(c *config.Config) error

func New added in v0.14.0

func New(r *gin.Engine, c *config.Config) error

func SetConfig added in v0.14.0

func SetConfig(c *config.Config) error

Types

type Config

type Config = config.Config

type Github

type Github = config.Github

type Permission added in v0.14.0

type Permission = config.Permission

type Server added in v0.14.0

type Server = config.Server

Directories

Path Synopsis
cmd
database
dao

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL