将推文拉入 Spotify 应用程序

发布于 2025-01-02 20:53:15 字数 1310 浏览 3 评论 0原文

我正在构建一个小型 Spotify 应用程序,用于显示当前正在播放的艺术家的推文。我正在使用 Bocoup 的 jQuery Twitter 插件来抓取并显示推文: http://code.bocoup .com/jquery-twitter-plugin/

MANIFEST.JSON

{
    "BundleType": "Application",
    "AppIcon": {
        "18x18": "tutorial.png"
    },
    "AppName": {
        "en": "News"
    },
    "SupportedLanguages": [
        "en"
    ],
    "RequiredPermissions": [
                "http://twitter.com"
                "http://*.twitter.com"
                "http://*.twimg.com"
    ],
    "VendorIdentifier": "com.News",
    "RequiredInterface": "1",
    "BundleVersion": "0.2",
    "BundleIdentifier": "News",
    "AppName": "News",
    "AppDescription": "Twitter updates from the Artist playing."
}

来自索引文件:

  <script type="text/javascript">
    $(document).ready(function() {
      $('#tweets').twitter({from: 'mediatemple', replies: false})
      launch();
    });
  </script>

</head>

<body>
<div id="info">
</div>
<div id="news">
</div>
<div id="tweets">
</div>
</body>

当我打开应用程序时,Spotify 中没有任何显示,但如果我在浏览器中打开 index.html 文件,则会显示推文。我缺少什么?

I'm building a little Spotify app that displays tweets from the current Artist playing. I'm using Bocoup's jQuery Twitter plugin to grab and display the tweets: http://code.bocoup.com/jquery-twitter-plugin/

MANIFEST.JSON

{
    "BundleType": "Application",
    "AppIcon": {
        "18x18": "tutorial.png"
    },
    "AppName": {
        "en": "News"
    },
    "SupportedLanguages": [
        "en"
    ],
    "RequiredPermissions": [
                "http://twitter.com"
                "http://*.twitter.com"
                "http://*.twimg.com"
    ],
    "VendorIdentifier": "com.News",
    "RequiredInterface": "1",
    "BundleVersion": "0.2",
    "BundleIdentifier": "News",
    "AppName": "News",
    "AppDescription": "Twitter updates from the Artist playing."
}

From the Index file:

  <script type="text/javascript">
    $(document).ready(function() {
      $('#tweets').twitter({from: 'mediatemple', replies: false})
      launch();
    });
  </script>

</head>

<body>
<div id="info">
</div>
<div id="news">
</div>
<div id="tweets">
</div>
</body>

Nothing displays in Spotify when I open my app, but if I open the index.html file in a browser, the tweets appear. What am I missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花落人断肠 2025-01-09 20:53:15

requiredPermissions JSON 需要逗号。

try:

"RequiredPermissions": [
            "http://twitter.com",
            "http://*.twitter.com",
            "http://*.twimg.com"
],

如果清单中存在问题,事情会默默失败。始终使用 JSON linter (http://jsonlint.com/) 至少验证 JSON 格式是否正确。

更新:对 manifest.json 进行任何更改后,您必须重新启动 Spotify。

The RequiredPermissions JSON needs commas.

try:

"RequiredPermissions": [
            "http://twitter.com",
            "http://*.twitter.com",
            "http://*.twimg.com"
],

Things fail silently if there is a problem in the manifest. Always use a JSON linter (http://jsonlint.com/) to verify at least the format is proper JSON.

UPDATE: After any changes to manifest.json you must restart Spotify.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文