從 Blogger Data API 擷取 JSON 資訊提供的簡單範例
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
簡介
本範例示範了使用 Blogger Data API 提供的 JSON 輸出格式,在 Blogger Beta 版代管網誌的近期文章清單。這可讓您查詢網誌的公開資訊提供,並取得傳回結果的 JSON 物件。如要使用新的 JSON 資訊提供,請建立 src
值的指令碼元素
https://blogname.blogspot.com/feeds/posts/default?alt=json-in-script&callback=myFunc
其中 blogname
是您要擷取的網誌,myFunc
則是傳入 JSON 物件的回呼函式名稱。如要進一步瞭解 Google Data API 的 JSON 輸出支援,請參閱 JSON 輸出支援說明文件。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-03-01 (世界標準時間)。
[null,null,["上次更新時間: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"]]