Git Product home page Git Product logo

demo's Introduction

beluga-connector

微念关键词实时数据

目前支持平台级功能

联想词 搜索结果 热榜
weibo
baidu
bilibili-pc
xiaohongshu

接口说明

1.联想词

/suggestion

请求方式: GET

请求参数

参数名 类型 内容 必要性 备注
platform str weibo 必要 平台名称
word str 李子柒 必要 搜索词

返回示例

{
    "code": 200, 
    "msg": "成功",
    "data": {
        "words": ["李子柒螺狮粉", "李子柒视频"]
    }
}

返回说明

{
    "code": {
        "成功": 200,
        "参数缺失": 401, 
        "参数错误": 402,
        "网络错误": 501,
        "解析失败": 502
    },
    "msg": {
        "成功": "成功",
        "参数缺失": "参数缺失: word", 
        "参数错误": "参数错误: {'platform': 'bili'}",
        "网络错误": "网络错误, 请求失败",
        "解析失败": "网页结构变化, 解析失败"
    },
    
    "data": {}
}

data 包含实际内容, 错误时为 {}

测试

// 启动 server
python3 index.py
// 运行测试代码
python3 test/suggestion.py

日志

CREATE TABLE IF NOT EXISTS `beluga`(
    `id` INT AUTO_INCREMENT COMMENT 'id, 主键',
    `ip` VARCHAR(20) COMMENT '客户端 ip',
    `ua` VARCHAR(100) COMMENT '客户端 ua',
    `path` VARCHAR(20) NOT NULL COMMENT '请求路由',
    `query` VARCHAR(100) NOT NULL COMMENT '请求参数',
    `response` TEXT NOT NULL COMMENT '响应内容',
    `time` DATETIME COMMENT '请求时间',
    PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

配置

  • secret
{
  "mysql": {
    "host": "127.0.0.1",
    "user": "",
    "password": "",
    "database": "",
    "port": 3306
  }
}

demo's People

Watchers

James Cloos avatar Grim avatar

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.