donglengyuan6826 2012-10-19 19:13
浏览 28

Soundcloud + PHP:在没有Soundcloud屏幕和上传曲目的情况下进行身份验证

I am building a simple site using the Soundcloud API that needs to do the following:

-- upload tracks to a single account without requesting user authentication (ie., Authenticating without the Soundcloud Screen)

-- display those tracks in a grid or list on a website, and on a map (I will be using the geo-tagging capability)

I am using PHP, which for most of this should be great. However - I am stuck on the authentication and upload piece, and am hungry for help or examples that might allow me to do this with PHP, or if I need to use Ruby or Python, how can I avoid rewriting the pieces I've done in PHP so far, and integrate the two things? If anyone can point me to how this can be done with PHP, that would be perfect!

Thank you.

  • 写回答

1条回答 默认 最新

  • dqwh1201 2012-10-21 23:23
    关注

    Upload tracks to a single account without requesting user authentication (ie., Authenticating without the Soundcloud Screen)

    Users will have to go to the popup screen. This is quite common for logging into third party services (think about how it works for Facebook Connect, or even for logging into Stack Overflow). It's also a security feature for users: they're effectively giving you the keys to their account, so it should be very clear what's happening.

    http://developers.soundcloud.com/docs/api/guide#authentication

    Display those tracks in a grid or list on a website, and on a map (I will be using the geo-tagging capability)

    This depends on what you mean by "those tracks": if you want all their tracks, then you can just use the API to fetch all tracks by a given user (/users/:user_id/tracks). If it's just the tracks they've uploaded using your app, you have a couple of different options depending on what you want to do.

    You can get all public tracks uploaded with your application (/apps/:app_id/tracks), but that would include tracks by everyone, and only public tracks. You could get all tracks by the current user (which would include private tracks) and then filter them inside your application by finding ones created with your app. This information is stored in the "created_with" property. eg:

         "created_with": {
            "id": 124,
            "name": "SoundCloud iPhone",
            "uri": "http://api.soundcloud.com/apps/124",
            "permalink_url": "http://soundcloud.com/apps/iphone"
          }
    

    Displaying them in a grid or a map, I think probably is a different question though...

    评论

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了