在我的rails项目中,我希望获得SoundCloud轨道/歌曲标题、描述、提供者数据,使用用户从他的SoundCloud帐户或任何SoundCloud链接提供的歌曲url。
发布于 2016-06-03 09:42:57
您可以为此使用SoundCloud API -请参阅SoundCloud URL部分。
如果您有特定资源的permalink URL,但需要更多信息,如ID或其他属性。在这些情况下,您可以使用/resolve端点提取资源的完整表示。
还有一个使用Ruby的例子
require 'soundcloud'
# create client with your app's credentials
client = Soundcloud.new(:client_id => 'YOUR_CLIENT_ID')
# a permalink to a track
track_url = 'http://soundcloud.com/forss/voca-nomen-tuum'
# resolve track URL into track resource
track = client.get('/resolve', :url => track_url)
# now that we have the track id, we can get a list of comments, for example
client.get("/tracks/#{track.id}/comments").each do |comment|
puts "Someone said: #{comment.body} at #{comment.timestamp}"
endhttps://stackoverflow.com/questions/37610812
复制相似问题