ตัวอย่างง่ายๆ ในการเรียกฟีด JSON จาก Blogger Data API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
บทนำ
ตัวอย่างนี้แสดงรายการโพสต์ล่าสุดจากบล็อกที่โฮสต์บน Blogger เบต้า โดยใช้รูปแบบเอาต์พุต JSON จาก Blogger Data API วิธีนี้ช่วยให้คุณค้นหาฟีดสาธารณะของบล็อกและรับรายการผลลัพธ์ที่ได้เป็นออบเจ็กต์ JSON ได้ หากต้องการใช้ฟีด JSON ใหม่ ให้สร้างองค์ประกอบสคริปต์ที่มีค่า src
https://blogname.blogspot.com/feeds/posts/default?alt=json-in-script&callback=myFunc
โดยที่ blogname
คือบล็อกที่ต้องการเรียก และ myFunc
คือชื่อของฟังก์ชันเรียกกลับที่ส่งผ่านออบเจ็กต์ JSON
ดูข้อมูลเพิ่มเติมเกี่ยวกับการรองรับเอาต์พุต JSON สําหรับ Google Data API ได้ที่เอกสารประกอบการสนับสนุนเอาต์พุต JSON
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2023-03-01 UTC
[null,null,["อัปเดตล่าสุด 2023-03-01 UTC"],[],[],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"]]