【问题标题】:Fortnite API htmlFortnite API html
【发布时间】:2018-07-18 10:31:10
【问题描述】:

我想将我的堡垒之夜统计数据放在我的网站 HTML/CSS 上。我找到this。 但是我对php不是很了解,所以我需要你的帮助。我必须删除这个:'your_api_key' 并放入:没有''的 your_api_key 吗?
还有这样的行:

    $this->auth = new Fortnite_Auth($this);
    $this->challenges = new Fortnite_Challenges($this);
    $this->leaderboard = new Fortnite_Leaderboard($this);
    $this->items = new Fortnite_Items($this);
    $this->news = new Fortnite_News($this);
    $this->patchnotes = new Fortnite_PatchNotes($this);
    $this->pve = new Fortnite_PVE($this);
    $this->status = new Fortnite_Status($this);
    $this->weapons = new Fortnite_Weapons($this);
    $this->user = new Fortnite_User($this)

我必须修改一些东西吗?

(这里有一些信息:
-user_id: 501b9f2dfda34249a2749467513172bf
-用户名:NoMaD_DEEPonion
-平台:电脑
-windows:第 5 季
)
对于所有这些代码,我使用了 xammp 服务器(我希望它很好)
感谢您的帮助

【问题讨论】:

    标签: php api server


    【解决方案1】:

    您应该始终引用 '' 您的键/字符串。所以它看起来像:

    $api->setKey('123qwerty456');
    $api->user->id('NoMaD_DEEPonion');
    

    请阅读他们的documentation。您应该从他们那里获得一个 API 密钥才能开始。而且您不必编辑Client.php。您应该改为包含文件。尝试包含Autoloader.php,因为它需要必要的文件。
    XAMPP 可以用于开发,但不适合生产/公共。祝你好运!

    【讨论】:

      【解决方案2】:

      @sykez 写了什么。

      我个人使用https://fortniteapi.com/ 来获取数据。他们还有一个带有不同请求的甜蜜 POSTMAN 页面https://documenter.getpostman.com/view/4499368/RWEjoGqD

      终于。我不确定这是否是一个开始学习 PHP 的好项目。我真的建议你在开始 API 调用、处理数组等之前先了解 PHP 的基础知识。

      【讨论】:

        猜你喜欢
        • 2018-09-27
        • 1970-01-01
        • 2021-03-12
        • 1970-01-01
        • 2021-12-13
        • 2021-12-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多