- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
在我的应用程序中,我想将 Soundcloud API 与我自己的 Soundcloud 用户一起使用。 Soundcloud API 身份验证过程涉及将用户重定向到 Soundcloud 主页,登录并授权应用程序,以便该页面可以使用该用户的 API。
我想自动化整个过程,因为我自己的用户是唯一获得身份验证的用户。这可能吗?
到目前为止,这是我的代码:
$soundcloud = new \Services_Soundcloud(
'**',
'**',
'http://**'
);
$authorizeUrl = $soundcloud->getAuthorizeUrl();
$accessToken = $soundcloud->accessToken();
try {
$me = json_decode($soundcloud->get('me'), true);
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
但是行 $accessToken = $soundcloud->accessToken();
抛出异常:
The requested URL responded with HTTP code 401.
500 Internal Server Error - Services_Soundcloud_Invalid_Http_Response_Code_Exception
最佳答案
Hi All,
Here I am going to share my experience with Soundcloud API (PHP)
查看我的问题:Link
Recently I started to work with Sound cloud API (PHP) and I decided to use PHP API by
https://github.com/mptre/php-soundcloud.
But When I was trying to get access token from Sound cloud server by this code:
// Get access token
try {
$accessToken = $soundcloud->accessToken($_GET['code']);
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}I had check the $_GET['code'] value. But strange there is nothing in $_GET['code'] this is blank. The Soundcloud was returning "The requested URL responded with HTTP code 0" error. That time I was testing Soundcloud on WAMP Localhost.
Allot of Goggling I found a solution to fix "The requested URL responded with HTTP code 0" issue. I had download 'cacert.pem' file and put inside our demo project folder (inside Services/Soundcloud/). Then after I added some code in 'class Services_Soundcloud'
function protected function _request($url, $curlOptions = array()).
// My code in side function
$curlPath = realpath(getcwd().'\Services\cacert.pem');
$curlSSLSertificate = str_replace("\\", DIRECTORY_SEPARATOR, $curlPath);
curl_setopt($ch, CURLOPT_CAINFO, $curlSSLSertificate);Saved 'class Services_Soundcloud' file and moved on live server. After move my project from WAMP to Live server I start to check it again. When I open my index.php it's ask me to login
I use my Facebook account to login.
after login it was asking to connect with Soundcloud
after connect everything working smooth, I got my info with
$me = json_decode($soundcloud->get('me'));
but a new problem start to occurring which was that my access token being expire again and again. Then I use session :D
// code for access token
$code = $_GET['code'];
// Get access token
try {
if(!isset($_SESSION['token'])){
$accessToken = $soundcloud->accessToken($code);
$_SESSION['token'] = $accessToken['access_token'];
}else{
$soundcloud->setAccessToken($_SESSION['token']);
}
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
现在一切都很棒。我可以获取我的所有详细信息,从 SC 服务器跟踪所有内容
希望它能帮助您与 Soundcloud API 干杯!!!! :)
关于php - 无需用户交互的自动 Soundcloud PHP Api 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8708791/
来自 SoundCloud API Guide ,这是获取声音的流媒体 URL 的方法: import soundcloud # create a client object with your ap
我和我的团队希望在我们正在构建的网站中使用嵌入式 SoundCloud 小部件。我们希望使用 API 通过跟踪每个轨道的 playback_count 属性来跟踪播放总数,但是我无法找到有关如何/何时
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我正在使用以下查询从 soundcloud 的 API 获取轨道列表,以检索 5 个最受欢迎的轨道: https://api.soundcloud.com/tracks?client_id=XXX&o
有没有办法在我的网站上嵌入 SoundCloud 关注按钮,以便用户可以关注网站上的页面/ channel ? 是否也有可能与 Vimeo 有类似的东西? 最佳答案 看起来 SoundCloud 通过
关闭。 这个问题不符合 Stack Overflow guidelines 。它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 关闭 5 年前。 Improve
我计划对上传到 SoundCloud 的音乐轨道中的情绪以及与这些轨道相关的元数据进行数据分析,以研究音乐内容中的情绪如何影响发布到其中的评论。 有什么方法可以下载可从 SoundCloud 下载的具
使用 Soundmanager2 获取元数据会遇到闪存权限问题。我想要的是访问轨道的元数据以生成视觉效果。 (其中的例子 here ) 我注意到一件事是你声明 Their api allows for
我无法在 HTTP API 文档中找到任何合适的内容。 据我所知,在当前轨道完成后,SC widget 中会弹出一些轨道,因此 SC 本身有一些相关的轨道功能,但我们可以通过 API 访问它吗? 即获
我在 node.js (Express) 应用程序中使用 Javascript SDK。 连接用户工作正常,但连接不会在页面重新加载之间持续存在。这是默认行为,还是用户应该在新请求中保持联系? 我是否
“喜欢”一首歌曲似乎很容易; PUT至/me/favorites/ 。但我在 API 文档中没有看到任何重新发布轨道的方法;我错过了什么吗? 最佳答案 稍微挖掘一下,网络用户界面似乎使用 PUT至/m
我确实到处找过,但不知道如何找到我可以在他们的嵌入代码中使用的用户 ID。有谁知道怎么查吗? 最佳答案 蒂姆的项目似乎被破坏了。我想我只需将解决方案复制并粘贴到此处即可。谢谢 subZero! cur
我在 node.js (Express) 应用程序中使用 Javascript SDK。 连接用户工作正常,但连接不会在页面重新加载之间持续存在。这是默认行为,还是用户应该在新请求中保持联系? 我是否
“喜欢”一首歌曲似乎很容易; PUT至 /me/favorites/ .但是我在 API 文档中看不到任何重新发布轨道的方法;我错过了什么吗? 最佳答案 稍微挖掘一下,Web UI 似乎使用了 PUT
我如何编辑 redirect_uri在我的 SoundCloud 应用程序仪表板中?我去http://soundcloud.com/you/apps但没有找到编辑按钮。 最佳答案 目前无法进行编辑,因
我正在尝试使用 WebService::Soundcloud 将声音上传到 soundcloud .到目前为止,我已经能够按照 the WebService::Soundcloud documenta
例如: http://soundcloud.com/mhiqu3/sets/heretik/ 如何获取缩略图网址:http://i1.sndcdn.com/artworks-000004897289-
我正在使用 /tracks用于检索歌曲统计信息的 API 端点,例如播放次数和收藏次数。我注意到 API 中的播放次数与网站上的播放次数不同。 这是一个例子 我在这里找到了解决方法 https://s
有什么方法可以通过 Soundcloud Python API 重新发布轨道吗?我有点麻烦。我尝试了 client.put('/me/track_reposts/trackID') 但它给了我一个 4
我继承了 Soundcloud ID 的数据库,并想建立一个页面链接到 Soundcloud 上的每个轨道。是否可以仅使用其 ID 链接到 Soundcloud 网站上的轨道,例如 http://ww
我是一名优秀的程序员,十分优秀!