从 Blogger Data API 检索 JSON Feed 的简单示例
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
简介
此示例演示了如何使用 Blogger Data API 提供的 JSON 输出格式显示 Blogger Beta 版的博客中近期发布的博文列表。这样,您就可以查询博客的公共 Feed,并获取生成的条目作为 JSON 对象。如需使用新的 JSON Feed,请创建一个 src
值为
https://blogname.blogspot.com/feeds/posts/default?alt=json-in-script&callback=myFunc
其中,blogname
是您要检索的博客,myFunc
是传递给 JSON 对象的回调函数的名称。
如需详细了解 Google 数据 API 的 JSON 输出支持,请参阅我们的 JSON 输出支持文档。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-03-01。
[null,null,["最后更新时间 (UTC):2023-03-01。"],[],[],null,["# Simple example of retrieving JSON feeds from Blogger Data API\n\n### Introduction\n\nThis sample demonstrates displaying a list of recent posts from a blog hosted on Blogger Beta\nusing the JSON output format provided by the Blogger Data API. This allows you to query a blog's\npublic feed and get the resulting entries returned as JSON objects. To use the new JSON feed,\ncreate a script element whose `src` value is\n\u003e `https://`**blogname** `.blogspot.com/feeds/posts/default?alt=json-in-script&callback=`**myFunc**\n\nwhere **`blogname`** is the blog you want to retrieve, and\n**`myFunc`** is the name of your callback function that is passed the JSON object.\nFor more information on JSON output support for Google Data APIs please see our\n[JSON output support documentation](/gdata/json).\n\n### Demo with data from googlemapsapi.blogspot.com"]]