douzhaochan6468 2012-12-05 15:39
浏览 49
已采纳

错误99 - 在last.fm php API调用中拒绝权限

I'm making a call to retrieve a user's latest tracks using the last.fm PHP api library. It works perfectly when I run it on my local webserver (localhost), but when I run it on a remote server it sends back an error code of 99, saying that permission has been denied.

Here is my code:

static function readRecentTracks() {
    $authVars['apiKey'] = '#########';
    $auth = new lastfmApiAuth('setsession', $authVars);
    $apiClass = new lastfmApi();
    $packageClass = $apiClass->getPackage($auth, 'user');
    $method_vars = array(
        'user' => 'liquidus219',
        'limit' => 25
    );

    if ($tracks = $packageClass->getRecentTracks($method_vars)) {
        echo json_encode($tracks);
    } else {
        echo '<b>Error '.$packageClass->error['code'].' - </b><i>'.$packageClass->error['desc'].'</i>';
    }
}

You can see the code in action at http://liquidus219.freehostia.com/api/?q=readRecentTracks

UPDATE: I have checked/changed the application URL to no effect.

UPDATE: I have gone through the code for the last.fm PHP api, no sign of an error 99 defined anywhere.

  • 写回答

1条回答 默认 最新

  • dongxu3029 2012-12-06 15:26
    关注

    I found out in the end that my hosting provider was blocking the call.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决