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 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题