Spotify Apps API:还有更多文档吗?
从昨天开始,我一直在尝试新的 Spotify Apps API但即使他们的在线文档非常好,我也找不到任何关于使用调用 getSpotifyApi(1)
后收到的 API 对象的信息。他们有某种在线 API 参考,但没有说明如何使用获取这些对象,如何访问图形等内置资源。总而言之,我觉得我错过了一些东西。 我可以通过使用开发人员检查器检查 API 并查看一些可用的应用程序来使用它。有什么办法可以查看Javascript代码吗?
I've been playing around with the new Spotify Apps API since yesterday but even though the documentation they have online is pretty good, I can't find anything on to use the API object you receive after calling getSpotifyApi(1)
. They have some sort of API reference online but no description of how to get these objects, how to access built-in resources such as graphics etc. All in all, I feel like I am missing something.
I was able to play around with it by examining the API using the developer inspector and looking at some of the available apps. Is there any way to look at the Javascript code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如其他人所说,可以浏览源代码并查看示例“API”应用程序,但这些都不再可用。因此,我整理了一个厨房水槽应用程序,它演示了如何执行许多基本功能。它可能对任何入门的人都派上用场:
https://github.com/ptrwtts/kitchensink
在自述文件中,还有有用资源的列表,但我将在此处复制其中一些以便于访问:
文档
Spotify Apps 文档:http://developer.spotify.com/en/spotify-apps-api/overview/
构建Spotify 应用程序:http://musicmachinery.com/2011/12/02/building-a-spotify-app/< /a>
PasteBin 示例: http://pastebin.com/u/MrSiir
应用程序
教程: http://developer.spotify.com/download/spotify-apps-api/tutorial/
情绪旋钮:https://github.com/alexmic/mood-knobs
Spartify:https://github.com/blixt/spartify
SpotifyEchoNestPlaylistDemo:https://gist.github.com/1438262
As others have said, it WAS possible to browse the source and view a sample "API" application, but neither of these are available anymore. For this reason, I have put together a kitchen sink application, which demonstrates how to perform much of the basic functionality. It may come in handy to anyone getting started:
https://github.com/ptrwtts/kitchensink
In the README, there is also a list of helpful resources, but I shall copy some of them here for easy access:
Docs
Spotify Apps Docs: http://developer.spotify.com/en/spotify-apps-api/overview/
Building a Spotify App: http://musicmachinery.com/2011/12/02/building-a-spotify-app/
PasteBin Examples: http://pastebin.com/u/MrSiir
Apps
Tutorial: http://developer.spotify.com/download/spotify-apps-api/tutorial/
Mood Knobs: https://github.com/alexmic/mood-knobs
Spartify: https://github.com/blixt/spartify
SpotifyEchoNestPlaylistDemo: https://gist.github.com/1438262
目前,文档非常稀疏。我发现查看应用程序包内的 Spotify.app 资源很有帮助。
在 Mac 上,您可以在应用程序包中找到一些有趣的来源:Spotify.app/Contents/Resources/cef_views
更新:使用新版本的 Spotify 预览版,我的解决方案不再完全适用。您仍然可以访问 Spotify.app/Contents/Resources/apps 中的一些资源,但它们现在被压缩为每个应用程序的一个文件。但是,您仍然可以通过查看这些文件来访问某些信息。
At the moment the documentation is very sparse. I found it helpful to have a look at Spotify.app's resources inside the application bundle.
On a mac you can find some interesting sources in the app bundle at: Spotify.app/Contents/Resources/cef_views
Update: With the new version of the spotify preview, my solution does not fully apply anymore. You can still access some of the resources at Spotify.app/Contents/Resources/apps but they are now compressed into one file per app. However, you can still access some of the information by looking into these files.
了解可能性的一个好方法是使用示例“api”应用程序。为此,请在搜索框中输入“spotify:app:api”,然后使用检查器查看包含的代码。
这里还有一个教程: http://developer.spotify.com/download /spotify-apps-api/tutorial/
希望这有帮助!如果您有疑问,也请随时联系[电子邮件受保护]。
A great way to see what is possible is to use the sample "api" app. Do that by typing "spotify:app:api" in the search box, and using the inspector to see what code is being included.
There is also a tutorial here: http://developer.spotify.com/download/spotify-apps-api/tutorial/
Hope this helps! Always contact [email protected] too if you have questions.
我只是在“sp”对象上执行 console.log 来跟踪它包含的所有对象。 sp 对象的命名易于理解,因此您可以更深入地了解 Spotify API。示例:
给您输出:
I just do a console.log on the "sp" object to trace out all objects that it contains. The sp objects has been named easily to undestand, so you can get a more indepth of the Spotify API. Example:
Gives you the output: