iTunes Music Store Link Maker — 如何从我的应用程序内搜索?
我正在编写一个音乐参考应用程序,并且对于每张专辑(从 last.fm 中提取)都希望链接到 ITMS(如果专辑在商店中)。
iTunes 链接制作器网络工具 http://apple.com/itunes/linkmaker/ 非常适合获取已知专辑的链接,但我需要从我的应用程序内以编程方式访问它。
这篇 NSLog 博文发表于 2003 年,但最近在另一个问题中引用似乎提供了唯一的解决方案到目前为止,我遇到过建议将查询提交到:
phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?
在其前面加上“itms://”,该链接将在 iTunes 中工作,在其前面加上“http://”,该链接将在 Camino 中工作(Safari 有时会返回格式错误的 XML 错误)。
重要的标签如下:
- songTerm - 歌曲标题
- artistTerm - 艺术家姓名
- albumTerm - 专辑名称
- composerTerm - 作曲家姓名
- 术语 - 所有字段
建议使用http:// 而不是itms:// 服务器将返回结果的 XML 文档,而不是打开 iTunes,但无论哪种方式,我都会直接发送到 iTunes。
是否可以取回结果列表?
I'm writing a music reference app and for each album (pulled from last.fm) would like to link to the ITMS (if the album is in the store).
iTunes link maker web tool http://apple.com/itunes/linkmaker/ is great for getting links for a known album but I need to access it programatically from within my app.
This NSLog blogpost which is from 2003 but was referenced more recently in another question here seems to offer the only solution I've come across so far, suggesting to submit a query to:
phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?
Put "itms://" before it and the link will work in iTunes, put "http://" before it and the link will work in Camino (Safari sometimes spits back a malformed XML error).
The tags that are of importance are as follows:
- songTerm - song title
- artistTerm - artist name
- albumTerm - album name
- composerTerm - composer name
- term - all fields
The suggestion is that would using http:// rather than itms:// the server will return an XML document of results instead of opening iTunes but either way I am sent directly to iTunes.
Is it possible to get back a list of results?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在使用 LinkMaker 获取有关我正在播放的歌曲的 iTunes 详细信息。
为此,我发现 LinkMaker 能够返回 json 数据并且一次返回 1 个结果。
我正在使用此网址来执行我的查询:
以下是您需要提供的参数:
例如,如果您想了解一首名为“的歌曲的详细信息”这里“U2”的“One”是正确的 URL:
http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/ itmsSearch?lang=1&output=json&country=US&term=U2%20one&media=music&limit=1
你将收到这样的 json 数据:
然后你需要解码这些 JSON 数据。
然后 终于得到你想要的:
如果你想确定用户的国家/地区,你将需要使用其区域设置确定其国家/地区,这是我正在使用的代码:
希望这会有所帮助。
蒂埃里
编辑:终于有一个文档可用:
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
I am using LinkMaker to get iTunes details about song I am playing.
For that, I found that LinkMaker is able to return json data and also 1 result at a time.
I am using this url to perfom my query :
Here are parameters you need to give :
For exemple, if you want to have details for a song called "One" by "U2" here is the correct URL :
http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/itmsSearch?lang=1&output=json&country=US&term=U2%20one&media=music&limit=1
Then you will receive json data like this :
You need then to decode these JSON data.
And finally get what you want :
If you want to determine user's country you will need to determine its country using its locale, here is the code I am using :
Hope this helps.
Thierry
Edit: Finally a doc is available:
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
本文档适用于 iTunes Store Web Service Search API (pdf)陈旧且不完整,似乎是实现这一目标的方法。
不过,与联盟计划的其他部分一样,设置此功能是一次痛苦的经历。
This document for iTunes Store Web Service Search API (pdf), although old and incomplete, seems to be the way to accomplish this.
It's a painful experience setting this up though, as has been every other part of the affiliate programme.