定制 ivankayzer/howlongtobeat 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ivankayzer/howlongtobeat

Composer 安装命令:

composer require ivankayzer/howlongtobeat

包简介

howlongtobeat.com provides information about games and how long it will take to finish them. This library is a simple wrapper to fetch data from Howlongtobeat website

README 文档

README

About

howlongtobeat provides information and data about games and how long it will take to finish them.

This library is a simple wrapper to fetch data from howlongtobeat.com. Please check their website and support them if you like what they are doing.

Install

Use the package manager composer to install howlongtobeat.

composer require ivankayzer/howlongtobeat

Usage

Search

use IvanKayzer\HowLongToBeat\HowLongToBeat;

$hl2b = new HowLongToBeat();
$hl2b->search('Lego');

returns

{
  "Results": [
    {
      "ID": "5265",
      "Image": "https://howlongtobeat.com/gameimages/220px-Lego_Lord_of_the_Rings_cover.jpg",
      "Title": "LEGO The Lord of the Rings: The Video Game",
      "Summary": {
        "Main Story": "10 Hours",
        "Main + Extra": "16 Hours",
        "Completionist": "33 Hours"
      }
    },
    {
      "ID": "5263",
      "Image": "https://howlongtobeat.com/gameimages/256px-Lego_Star_Wars-The_Complete_Saga.jpg",
      "Title": "LEGO Star Wars: The Complete Saga",
      "Summary": {
        "Main Story": "14 Hours",
        "Main + Extra": "23 Hours",
        "Completionist": "39.5 Hours"
      }
    },
    {
      "ID": "16635",
      "Image": "https://howlongtobeat.com/gameimages/LegoTheHobbit.jpg",
      "Title": "LEGO The Hobbit",
      "Summary": {
        "Main Story": "9 Hours",
        "Main + Extra": "16 Hours",
        "Completionist": "35.5 Hours"
      }
    },
  ...
  ],
  "Pagination": {
    "Current Page": 1,
    "Last Page": 4
  }
}

You can also pass a page number as a second argument to search:

$hl2b->search('Lego', 2);

Get time entries by game ID

use IvanKayzer\HowLongToBeat\HowLongToBeat;

$hl2b = new HowLongToBeat();
$hl2b->get(5265);

returns

{
  "ID": 5265,
  "Title": "LEGO The Lord of the Rings: The Video Game",
  "Image": "https://howlongtobeat.com/gameimages/220px-Lego_Lord_of_the_Rings_cover.jpg",
  "Description": "LEGO The Lord of the Rings is based on The Lord of the Rings motion picture trilogy and follows the original storylines of The Lord of the Rings: The Fellowship of the Ring, The Lord of the Rings: The Two Towers, and The Lord of the Rings: The Return of the King. Now the entire family can team up in pairs as adorable LEGO The Lord the Rings minifigures to experience countless dangers, solve riddles and battle formidable foes on their journey to Mount Doom.",
  "Developer": "Traveller's Tales",
  "Publisher": "Warner Bros. Interactive Entertainment",
  "Last Update": "4 Hours Ago",
  "Playable On": "PC, Nintendo 3DS, Nintendo DS, PlayStation 3, PlayStation Vita, Wii, Wii U, Xbox 360, Xbox One",
  "Genres": "Action, Adventure, Open World",
  "Statistics": {
    "Playing": "220",
    "Backlogs": "2300",
    "Replays": "34",
    "Retired": "5%",
    "Rating": "75%",
    "Beat": "1100"
  },
  "Summary": [
    {
      "Title": null,
      "Time": {
        "Main Story": "10 Hours",
        "Main + Extras": "16 Hours",
        "Completionist": "33 Hours",
        "All Styles": "17.5 Hours"
      }
    }
  ],
  "Single-Player": {
    "Main Story": {
      "Polled": "182",
      "Average": "9h 55m",
      "Median": "10h",
      "Rushed": "7h 25m",
      "Leisure": "14h 58m"
    },
    "Main + Extras": {
      "Polled": "109",
      "Average": "16h 48m",
      "Median": "15h",
      "Rushed": "11h 23m",
      "Leisure": "27h 57m"
    },
  ...
  },
  "Speedrun": {
    "Any%": {
      "Polled": "2",
      "Average": "4h 51m 43s",
      "Median": "4h 51m 43s",
      "Fastest": "4h 23m 56s",
      "Slowest": "5h 19m 30s"
    }
  },
  "Multi-Player": {
    "Co-Op": {
      "Polled": "14",
      "Average": "17h 12m",
      "Median": "13h 27m",
      "Least": "10h 54m",
      "Most": "28h 15m"
    }
  },
  "Platform": {
    "Nintendo 3DS": {
      "Polled": "24",
      "Main": "9h 34m",
      "Main +": "21h 15m",
      "100%": "22h 56m",
      "Fastest": "4h 52m",
      "Longest": "60h"
    },
  ...
  }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

统计信息

  • 总下载量: 84
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固