GithubHelp home page GithubHelp logo

asfrequest's Introduction

ASFRequest


描述

ASFRequest 是为ArchiSteamFarm 开发的一款拓展插件,使其可以利用ASF的一切能力转发所有请求。

使用场景:

  • 不熟悉.net开发,通过网络接口的方式拓展任意功能
  • 临时需要某个功能但是不想开发插件,不想重启ASF
  • 需要批量对机器人统一进行某些操作
  • ..........................

安装方式

  1. 从 GitHub Releases 下载插件
  2. 将 ASFRequest.dll 解压至 ASF 的 plugins 文件夹
  3. 重新启动 ArchiSteamFarm

接口列表

swagger接口文档地址:http://{host}:{port}/swagger
接口 类型 参数 备注
/Api/ASFRequest/AddBot POST 数组参数
BotName: 机器人名称
BotConfig: 配置
MaFile: 令牌
批量添加机器人
/Api/ASFRequest/GetState/{botNames} POST Url: 请求链接
WithSession: 登录状态
Referer: Referer来源
Headers: 自定义请求头
GET请求返回状态
/Api/ASFRequest/GetHtml/{botNames} POST Url: 请求链接
WithSession: 登录状态
Referer: Referer来源
Headers: 自定义请求头
Xpath: Xpath过滤
GET请求返回Html
/Api/ASFRequest/GetJson/{botNames} POST Url: 请求链接
WithSession: 登录状态
Referer: Referer来源
Headers: 自定义请求头
GET请求返回Json
/Api/ASFRequest/PostHtml/{botNames} POST Url: 请求链接
WithSession: 登录状态
Referer: Referer来源
Headers: 自定义请求头
Xpath: Xpath过滤
POST请求返回Html
/Api/ASFRequest/PostHtml/{botNames} POST Url: 请求链接
WithSession: 登录状态
Referer: Referer来源
Headers: 自定义请求头
BodyData: json参数
POST请求返回Json

使用示例 (以CURL为例)

  1. 获取游戏PUBG: BATTLEGROUNDS 的评测情况。

    请求方式:

    curl -X 'POST' \
      'http://localhost:1242/Api/ASFRequest/GetHtml/asf' \
      -H 'accept: application/json' \
      -H 'Authentication: password' \
      -H 'Content-Type: application/json' \
      -d '{
      "Url": "https://store.steampowered.com/app/578080/PUBG_BATTLEGROUNDS/",
      "WithSession": true,
      "Referer": "https://store.steampowered.com",
      "Xpath": "//*[@id='\''userReviews'\'']"
    }'
    
    

    返回内容:

    {
      "Result": {
        "robotName1": {
     	 "Result": "最近评测:褒贬不一(19,583)- 过去 30 天内的 19,583 篇用户评测中有 69% 为好评。全部评测:褒贬不一(2,342,656)- 此游戏的 2,342,656 篇用户评测中有 58% 为好评。",
     	 "Message": "OK",
     	 "Success": true
        },
        "robotName2": {
     	 "Result": "最近评测:褒贬不一(19,583)- 过去 30 天内的 19,583 篇用户评测中有 69% 为好评。全部评测:褒贬不一(2,342,656)- 此游戏的 2,342,656 篇用户评测中有 58% 为好评。",
     	 "Message": "OK",
     	 "Success": true
        }
      },
      "Message": "OK",
      "Success": true
    }
    
  2. 添加游戏 PUBG: BATTLEGROUNDS 到愿望单列表。

    请求方式:

    curl -X 'POST' \
      'http://localhost:1242/Api/ASFRequest/PostJson/asf' \
      -H 'accept: application/json' \
      -H 'Authentication: password' \
      -H 'Content-Type: application/json' \
      -d '{
      "Url": "https://store.steampowered.com/api/addtowishlist",
      "WithSession": true,
      "Referer": "https://store.steampowered.com",
      "BodyData": {
        "appid": "578080"
      }
    }'
    

    返回内容:

    {
      "Result": {
        "robotName1": {
     	 "Result": {
     	   "success": true,
     	   "wishlistCount": 10
     	 },
     	 "Message": "OK",
     	 "Success": true
        },
        "robotName2": {
     	 "Result": {
     	   "success": true,
     	   "wishlistCount": 7
     	 },
     	 "Message": "OK",
     	 "Success": true
        }
      },
      "Message": "OK",
      "Success": true
    }
    

asfrequest's People

Contributors

jskils avatar

Stargazers

siri Ren avatar fat_colonel avatar  avatar

Watchers

 avatar

asfrequest's Issues

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.