How to upload multiple blog posts in BlogSpot at once?(如何在BlogSpot中一次上传多篇博客文章?)
本文介绍了如何在BlogSpot中一次上传多篇博客文章?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一共写了86篇博文。我试着手动上传,但似乎是一个很长的过程,所以我决定用XML文件制作它,并进行了处理,但Web上没有XML格式的帮助。这是我尝试使用的代码,
<?xml version='1.0' encoding='UTF-8'?>
<ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom">
<ns0:generator>Blogger</ns0:generator>
<ns0:entry>
<ns0:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post" />
<ns0:category scheme="http://www.blogger.com/atom/ns#" term="CATEGORY A" />
<ns0:id>BLOGGER TEST</ns0:id>
<ns0:content type="html">Blogger CONTENT</ns0:content>
<ns0:title type="html">BLOGGER TITLE</ns0:title>
</ns0:entry>
</ns0:feed>
如果使用XML是不好的选择,那么使用Python或任何其他编码的可能性都不大。
推荐答案
您可以通过向带有post Json正文的帖子收集URI发送POST请求来为博客添加帖子:
https://www.googleapis.com/blogger/v3/blogs/YOUR_BLOG_ID/posts/
请求(您必须经过身份验证才能创建帖子):
POST https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/
Authorization: /* OAuth 2.0 token here */
Content-Type: application/json
{
"kind": "blogger#post",
"blog": {
"id": "8070105920543249955"
},
"title": "A new post",
"content": "With <b>exciting</b> content..."
}
响应(如果您的请求成功,您将获得HTTP 200 OK状态):
{
"kind": "blogger#post",
"id": "6819100329896798058",
"blog": {
"id": "8070105920543249955"
},
"published": "2012-05-20T20:08:00-07:00",
"updated": "2012-05-20T20:08:35-07:00",
"url": "http://brettmorgan-test2.blogspot.com/2012/05/new-post.html",
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058",
"title": "A new post",
"content": "With <b>exciting</b> content...",
"author": {
"id": "16258312240222542576",
"displayName": "Brett Morgan",
"url": "http://www.blogger.com/profile/16258312240222542576",
"image": {
"url": "https://resources.blogblog.com/img/b16-rounded.gif"
}
},
"replies": {
"totalItems": "0",
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/8070105920543249955/posts/6819100329896798058/comments"
}
}
更多详情,请阅读接口文档。 https://developers.google.com/blogger/docs/3.0/using
这篇关于如何在BlogSpot中一次上传多篇博客文章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:如何在BlogSpot中一次上传多篇博客文章?


猜你喜欢
- 我如何卸载 PyTorch? 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01