使得JSON调用非官方潘多拉API [英] Making JSON calls to Unoffical Pandora API

查看:170
本文介绍了使得JSON调用非官方潘多拉API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在工作中收听Pandora和像,文,这将是很酷获得潘多拉电台列表,或者用它在某些能力进行远程交互。

So I was listening to Pandora at work, and was like, Man, it would be really cool to get the station list of Pandora, or interact with it remotely in some capacity..

于是我发现了这个非官方的潘多拉的API,它只是返回一串看起来pretty有益的,整齐的JSON对象!这里是链接到API: HTTP://pan-do-ra-api.wikia。 COM /维基/ JSON的/ 5

So I found this unofficial Pandora API which just returns a bunch of JSON objects which look pretty helpful and neat! Here is the link to the API: http://pan-do-ra-api.wikia.com/wiki/Json/5

的问题是我从来没有真正使用JSON,绝对没有用过这个API,所以我不知道如何去做事。我认为,如果有人给了我怎么说从我的Windows 7桌面电脑电台列表,这将是真正的帮助,我也许可以从那里。

The problem is I have never really used JSON and definitely never used this API so I am not sure how to go about doing things. I think that if someone gave me an example of how to say get the station list from my windows 7 desktop computer that would be really helpful and I could probably get the rest from there.

谢谢!

推荐答案

再次与马克·B中的意见,我部分同意。然而,更一般地回答你的问卷它可能不值得你的时间。

Again, with the comments from Marc B, I somewhat agree. However, to more generically answer your question- it's probably not worth your time.

潘多拉请求/响应机构全部发送的HTTP / HTTPS。然而,它们都被加密。还有,你可以用它来加密和解密的响应键的公之列。一旦你所有这一切整理出来,你将不得不使用的API。

Pandora request / response bodies are all sent over HTTP/HTTPS. However, they are all encrypted. There is a "public" list of keys you can use to encrypt and decrypt the responses. Once you have sorted all of that out, you'll have to use the APIs.

首先,你必须给用户以获得身份验证令牌身份验证。从那里,你可以访问哪些需要身份验证令牌的API。

First you have to authenticate the user to get an Auth token. From there, you can access the APIs which require the auth tokens.

要你的最后一点,JSON接口在许多不同的方式工作。有时,API通过URL本身就像指定
http://example.com/json/foo

To your final point, JSON interfaces work in lots of different ways. Sometimes the API is specified through the URL itself like http://example.com/json/foo

其他时候,它是在请求主体指定通过POST。

Other times, it's specified in the request body through a POST.

如果你真的想算出这个,我会用它玩。我怀疑有人将张贴在如何操作的API是不是真正的公共code。潘多拉改变它有点经常有目的地打破第三方应用程序。

If you really want to figure this out, I would play with it. I doubt anybody will post code on how to manipulate an API that isn't really "public". Pandora changes it somewhat frequently to purposefully break third party applications.

一个简单的JSON例如:

A simple JSON example:

POST到 http://example.com/json/foo

{ param: "val",
  anotherParam: "val",
  responseType: "XML" }

响应可能类似于

{ status: 200,
  result: "you called the foo API" }

这篇关于使得JSON调用非官方潘多拉API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆