如何将博客中的内容提取到我的网页上?

时间:2021-11-28 03:45:11

I want to dynamically pull the posts from blogger to my HTML/CSS/PHP webpage. What would be the best way to go about doing that? For that, should I use JavaScript, PHP, AJAX or something else?

我想动态地将帖子从博客上拉到我的HTML / CSS / PHP网页。这样做的最佳方式是什么?为此,我应该使用JavaScript,PHP,AJAX还是其他什么?

1 个解决方案

#1


0  

You could use jQuery .ajax() request using Blogger API.

您可以使用Blogger API使用jQuery .ajax()请求。

https://developers.google.com/blogger/docs/3.0/using#RetrievingABlog

For example: (something like this, not tested)

例如:(类似这样,未经测试)

$.ajax({
    type: "GET",
    dataType: "jsonp",
    url: "https://www.googleapis.com/blogger/v3/blogs/2399953?key=YOUR-API-KEY",
    success: function(data) {
        console.log(data);
    }
});

For posts it looks like you will need to use this URL and whatever your API key is.

对于帖子,您似乎需要使用此URL以及您的API密钥。

https://www.googleapis.com/blogger/v3/blogs/2399953/posts?key=YOUR-API-KEY

#1


0  

You could use jQuery .ajax() request using Blogger API.

您可以使用Blogger API使用jQuery .ajax()请求。

https://developers.google.com/blogger/docs/3.0/using#RetrievingABlog

For example: (something like this, not tested)

例如:(类似这样,未经测试)

$.ajax({
    type: "GET",
    dataType: "jsonp",
    url: "https://www.googleapis.com/blogger/v3/blogs/2399953?key=YOUR-API-KEY",
    success: function(data) {
        console.log(data);
    }
});

For posts it looks like you will need to use this URL and whatever your API key is.

对于帖子,您似乎需要使用此URL以及您的API密钥。

https://www.googleapis.com/blogger/v3/blogs/2399953/posts?key=YOUR-API-KEY