Code Monkey home page Code Monkey logo

creditget's Introduction

creditget

discuz 通用论坛用户积分爬取排序。

可以爬取论坛内所有用户积分等各类信息,并排序后生成 markdown 表格展示。

使用 SQLite 储存,Go 编写,多协程爬取。

使用

编译后,复制项目内的 config.json,修改其中的各项配置。

{
    "start": 1, //起始 uid 左闭右开
    "end": 3709554, //结束 uid 
    "thread": 8, //使用的协程数
    "sleepTime": 500, //某个协程爬取一次后睡眠多少毫秒
    "disucuzApiAddress": "https://www.mcbbs.net/api/mobile/index.php?version=4&module=profile&uid=", // api 地址
    "points": {
        "extcredits1": "人气",
        "extcredits2": "金粒",
        "extcredits3": "金锭",
        "extcredits4": "绿宝石",
        "extcredits5": "下界之星",
        "extcredits6": "贡献",
        "extcredits7": "爱心",
        "extcredits8": "钻石"
    },
    "fast": {
        "on": true, //快速获取,利用下方 uid 对应的用户的好友,快速获取其好友的信息,以此递归。
        "uid": 1, 
        "layers": 8
    }
}

extcredits1 等和积分名字的对应关系可来形如 https://www.mcbbs.net/api/mobile/index.php?version=4&module=profile&uid=1 底部查看

未使用的 extcredits 可直接删除这个字段。

{
    "start": 0, 
    "end": 3709554, 
    "thread": 8, 
    "sleepTime" : 500, 
    "disucuzApiAddress": "https://www.mcbbs.net/api/mobile/index.php?version=4&module=profile&uid=",
    "extcredits1": "人气",
    "extcredits2": "金粒",
    "extcredits3": "金锭"
}

形如 https://www.mcbbs.net/api/mobile/index.php?version=4&module=check 中的 totalmembers 数值为论坛总人数。

然后直接执行程序即可爬取,爬取完成后会自动退出。中途若意外退出,再次运行可按上次的进度继续爬取。

执行时带上任意参数即可生成展示表格,如 ./main a

creditget's People

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.