東川印記

一本東川,笑看爭龍斗虎;寰茫兦者,度橫佰昧人生。

网易博客导入blogspot之02语法解析

2016年8月12日星期五



昨天死活导不进去,从里面导出来的也无法导入

今天去台湾的一个论坛问了下,发现blogspot每天是有导入限制的,后面的应该是超过了导入限制,即便格式对也无法正常导入

然后试了一个简单的,竟然导入成功了。。。。。。

第一个成功的内容如下
111.xml:
  1. <?xml version="1.0"?>
  2. <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0">
  3.   <id>tag:blogger.com,1999:blog-1.archive</id>
  4.   <updated>2008-09-10T10:44:09.799-07:00</updated>
  5.   <title>test123456标题1111</title>
  6.   <link href="http://www.blogger.com/feeds/1/archive" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
  7.   <link href="http://test123451111111116.blogspot.com" rel="alternate" type="text/html"/>
  8.   <link href="http://www.blogger.com/feeds/1/archive" rel="self" type="application/atom+xml"/>
  9.   <author>
  10.     <name>test123456</name>
  11.     <uri>http://www.blogger.com/profile/1</uri>
  12.     <email>noreply@blogger.com</email>
  13.   </author>
  14.   <generator uri="http://www.blogger.com" version="7.00">Blogger</generator>
  15.   <entry>
  16.     <id>tag:blogger.com,1999:blog-1.post-1</id>
  17.     <published>2016-08-12T10:44:30.000+08:00</published>
  18.     <updated>2016-08-12T10:44:30.000+08:00</updated>
  19.     <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post"/>
  20.     <title type="text">导入啊</title>
  21.     <content type="html">导入吧</content>
  22.     <link href="http://tesafsdfa.blogspot.com/2008/09/test1.html" rel="alternate" title="test1" type="text/html"/>
  23.     <link href="http://www.blogger.com/feeds/1/posts/default/1" rel="self" type="application/atom+xml"/>
  24.     <author>
  25.       <name>test12啊啊啊啊啊3456</name>
  26.       <uri>http://www.blogger.com/profile/1</uri>
  27.       <email>noreply@blogger.com</email>
  28.     </author>
  29.   </entry>
  30. </feed>

看来只要符合这个格式就可以了,然后把昨天导出来的改成这个格式,发现也可以导入成功

那么
解析下格式吧
blog-08-11-2016.xml:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--  atom格式的xml-->
  3. <?xml-stylesheet href="https://www.blogger.com/styles/atom.css" type="text/css"?>
  4. <!-- feed标签 -->
  5. <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss">
  6.   <id>tag:blogger.com,1999:blog-171507978679241883.archive</id>
  7.   <updated>2016-08-11T20:02:46.260-07:00</updated>
  8.   <title type="text">TEST BY SENRSL</title>
  9.   <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/archive"/>
  10.   <link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/archive"/>
  11.   <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/archive"/>
  12.   <link rel="alternate" type="text/html" href="http://testbysenrsl.blogspot.com/"/>
  13.   <author>
  14.     <name>senRsl Zhao</name>
  15.     <email>noreply@blogger.com</email>
  16.     <gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-oUkhvUhgg_E/AAAAAAAAAAI/AAAAAAAAAAA/dPY0WOz15ME/s32-c/photo.jpg"/>
  17.   </author>
  18.   <generator version="7.00" uri="https://www.blogger.com">Blogger</generator>
  19.  
  20.   <!-- 上面都不需要改 -->
  21.  
  22.  <!-- 一个entry是一个记录 -->
  23.   <entry>
  24.       <!-- 唯一的,评论要对应这个,前面的883是blog id,后面的093是帖子id -->
  25.     <id>tag:blogger.com,1999:blog-171507978679241883.post-5127061826790740093</id>
  26.     <!-- 发布时间 -->
  27.     <published>2004-08-11T02:25:00.001-07:00</published>
  28.     <!-- 更新时间 -->
  29.     <updated>2016-08-11T02:26:32.033-07:00</updated>
  30.     <!-- 里面的draft=yes,说明这是一个草稿 -->
  31.     <app:control xmlns:app="http://purl.org/atom/app#">
  32.       <app:draft>yes</app:draft>
  33.     </app:control>
  34.     <!-- 标签 -->
  35.     <category scheme="http://www.blogger.com/atom/ns#" term="测试二号"/>
  36.     <!-- 最后post是正文,如果是comment是评论 -->
  37.     <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post"/>
  38.     <!-- 这条记录的标题 -->
  39.     <title type="text">导入草稿测试二次修改版</title>
  40.      <!-- 这条记录的内容 -->
  41.     <content type="html">这是一个导入的草稿二次修改啊啊啊</content>
  42.     <!-- 修改链接地址,注意后面那个数字跟上面id数字是对应的-->
  43.     <link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/posts/default/5127061826790740093"/>
  44.     <!-- 自身地址 -->
  45.     <link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/posts/default/5127061826790740093"/>
  46.     <!-- 作者信息 -->
  47.     <author>
  48.       <name>senRsl Zhao</name>
  49.       <uri>https://plus.google.com/100743021429432655774</uri>
  50.       <email>noreply@blogger.com</email>
  51.       <gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-oUkhvUhgg_E/AAAAAAAAAAI/AAAAAAAAAAA/dPY0WOz15ME/s32-c/photo.jpg"/>
  52.     </author>
  53.     <thr:total>0</thr:total>
  54.   </entry>
  55.  
  56.   <!-- 第二个帖子 -->
  57.   <entry>
  58.     <id>tag:blogger.com,1999:blog-171507978679241883.post-222869801414084761</id>
  59.     <published>2012-09-11T01:04:00.002-07:00</published>
  60.     <updated>2013-02-11T01:04:37.374-07:00</updated>
  61.     <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post"/>
  62.     <category scheme="http://www.blogger.com/atom/ns#" term="测试一号"/>
  63.     <title type="text">导入导出测试啊啊啊啊2016年08月12日11:08:00二次修改识别</title>
  64.     <content type="html">如题11范德萨飞洒范德萨内容发的说法上打法</content>
  65.     <link rel="replies" type="application/atom+xml" href="https://testbysenrsl.blogspot.com/feeds/222869801414084761/comments/default" title="帖子评论"/>
  66.     <link rel="replies" type="text/html" href="http://testbysenrsl.blogspot.com/2016/08/blog-post.html#comment-form" title="2 条评论"/>
  67.     <link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/posts/default/222869801414084761"/>
  68.     <link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/posts/default/222869801414084761"/>
  69.     <link rel="alternate" type="text/html" href="http://testbysenrsl.blogspot.com/2016/08/blog-post.html" title="导入导出测试"/>
  70.     <author>
  71.       <name>senRsl Zhao</name>
  72.       <uri>https://plus.google.com/100743021429432655774</uri>
  73.       <email>noreply@blogger.com</email>
  74.       <gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-oUkhvUhgg_E/AAAAAAAAAAI/AAAAAAAAAAA/dPY0WOz15ME/s32-c/photo.jpg"/>
  75.     </author>
  76.     <!-- 这条记录有两条评论 -->
  77.     <thr:total>2</thr:total>
  78.   </entry>
  79.  
  80.   <!-- 第二个帖子的第一个评论 -->
  81.   <entry>
  82.     <id>tag:blogger.com,1999:blog-171507978679241883.post-4116591716262517041</id>
  83.     <published>2013-08-11T02:26:47.831-07:00</published>
  84.     <updated>2014-08-11T02:26:47.831-07:00</updated>
  85.     <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#comment"/>
  86.     <title type="text">这时一篇评论文章啊啊啊标题2016年08月12日11:30:58</title>
  87.     <content type="html">这时一篇评论文章内容</content>
  88.     <link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/222869801414084761/comments/default/4116591716262517041"/>
  89.     <link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/222869801414084761/comments/default/4116591716262517041"/>
  90.     <link rel="alternate" type="text/html" href="http://testbysenrsl.blogspot.com/2016/08/blog-post.html?showComment=1470907607831#c4116591716262517041" title=""/>
  91.     <author>
  92.       <name>senRsl Zhao</name>
  93.       <uri>https://www.blogger.com/profile/11987603322719380386</uri>
  94.       <email>noreply@blogger.com</email>
  95.       <gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-oUkhvUhgg_E/AAAAAAAAAAI/AAAAAAAAAAA/dPY0WOz15ME/s32-c/photo.jpg"/>
  96.     </author>
  97.     <thr:in-reply-to href="http://testbysenrsl.blogspot.com/2016/08/blog-post.html" ref="tag:blogger.com,1999:blog-171507978679241883.post-222869801414084761" source="https://www.blogger.com/feeds/171507978679241883/posts/default/222869801414084761" type="text/html"/>
  98.     <gd:extendedProperty name="blogger.itemClass" value="pid-1770457059"/>
  99.     <gd:extendedProperty name="blogger.displayTime" value="2016年8月11日 上午2:26"/>
  100.   </entry>
  101.  
  102.     <!-- 第二个帖子的第二个评论 -->
  103.   <entry>
  104.     <id>tag:blogger.com,1999:blog-171507978679241883.post-6751649727143437779</id>
  105.     <published>2015-08-11T20:02:46.261-07:00</published>
  106.     <updated>2016-08-11T20:02:46.261-07:00</updated>
  107.     <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#comment"/>
  108.     <title type="text">这时第二个评论的标题</title>
  109.     <content type="html">这时第二个评论的大大大内容</content>
  110.     <link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/222869801414084761/comments/default/6751649727143437779"/>
  111.     <link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/171507978679241883/222869801414084761/comments/default/6751649727143437779"/>
  112.     <link rel="alternate" type="text/html" href="http://testbysenrsl.blogspot.com/2016/08/blog-post.html?showComment=1470970966261#c6751649727143437779" title=""/>
  113.     <author>
  114.       <name>senRsl Zhao</name>
  115.       <uri>https://www.blogger.com/profile/11987603322719380386</uri>
  116.       <email>noreply@blogger.com</email>
  117.       <gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-oUkhvUhgg_E/AAAAAAAAAAI/AAAAAAAAAAA/dPY0WOz15ME/s32-c/photo.jpg"/>
  118.     </author>
  119.     <thr:in-reply-to href="http://testbysenrsl.blogspot.com/2016/08/blog-post.html" ref="tag:blogger.com,1999:blog-171507978679241883.post-222869801414084761" source="https://www.blogger.com/feeds/171507978679241883/posts/default/222869801414084761" type="text/html"/>
  120.     <gd:extendedProperty name="blogger.itemClass" value="pid-1770457059"/>
  121.     <gd:extendedProperty name="blogger.displayTime" value="2016年8月11日 下午8:02"/>
  122.   </entry>
  123. </feed>




找了一遭,发现网易博客,新浪微博,blogspot都是有api的,太好了





--
senRsl
2016年08月12日11:27:11

没有评论 :

发表评论