Thứ Ba, 27 tháng 12, 2016

Hướng dẫn import bài viết vào Blogspot

( Khởi nghiệp với Internet)

Về cơ bản chúng ta cần quan tâm tới những vấn đề sau

1. Category trong blogspot

– Cấu trúc Category trong Blogspot có dạng :
<ns0:category scheme='http://www.blogger.com/atom/ns#' term='demo 1'/>
– Nếu bài viết nằm ở nhiều mục thì chúng ta có thể khai báo như dưới đây :
<ns0:category scheme='http://www.blogger.com/atom/ns#' term='demo 1'/>
<ns0:category scheme='http://www.blogger.com/atom/ns#' term='demo 2'/>
<ns0:category scheme='http://www.blogger.com/atom/ns#' term='demo 3'/>

2. Nội dung bài viết trong Blogspot

– Nội dung bài viết của Blogspot thường được nằm trong thẻ:
<ns0:content type="html">Đây là nội dung</ns0:content>

3. Định dạng về thời gian trong Blogspot

– Định dạng cơ bản của bài viết trong Blogspot là Năm-Tháng-NgàyTGiờ-Phút-Giây.001-07:00, với các thông số sau là về múi giờ.
– Ví dụ về định dạng ngày tháng của Blogspot: 2013-10-29T04:22:00.001-07:00
nếu file XML có hàng nghìn bài viết thì làm sao để chỉnh tất cả post theo thơi gian lần lượt 3h//post
public function generateDate($days = 0){$dayTime = 24 * 60 * 60;$timeRange = floor($dayTime / $this->postPerDay);$randomTimeArr = array();for($i = 0; $i < $this->postPerDay; $i++){// Day$randomTime = ceil(time() / 3600) * 3600 + ($days * $dayTime);// Random time in $timeRange$randomTime += $timeRange;$randomTime += $timeRange * $i + floor($timeRange * (rand(0, 1000) / 1000));$randomTime += $this->adjustDateTime;// Format Date$randomTime = date($this->timeFormat, $randomTime);// Add random time$randomTimeArr[$i] = $randomTime;}
return $randomTimeArr;
1 triệu bài viết cũng OK nhé, chỉ việc điền vào số post/1 ngày là 8, như vậy sau khoảng thời gian ngẫu nhiên 3h thì blogspot sẽ post 1 bài.


1 1. Cấu trúc file XML đơn giản nhất của bài viết trên Blogspot:
2 2. Cấu trúc bài viết trên file XML có kèm Category:
3 3. Cấu trúc bài viết trên file XML có kèm Category, Time:
4 4. Cấu trúc bài viết trên file XML với nhiều Category, Entry:

– Có rất nhiều cách để import nội dung vào Blogspot của Google. Tuy nhiên, cách phổ biến nhất vẫn là import trực tiếp file XML vào Blogspot.
– Để import được chúng ta phải hiểu cấu trúc của một bài viết trên Blogspot.

1. Cấu trúc file XML đơn giản nhất của bài viết trên Blogspot:


<?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:id>BLOGGER TEST</ns0:id>
<ns0:content type="html">Blogger CONTENT</ns0:content>
<ns0:published>2013-10-29T03:22:00.001-07:00</ns0:published>
<ns0:title type="html">BLOGGER TITLE</ns0:title>
</ns0:entry>
</ns0:feed>

2. Cấu trúc bài viết trên file XML có kèm Category:


<?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>

3. Cấu trúc bài viết trên file XML có kèm Category, Time:


<?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:published>2013-10-29T03:22:00.001-07:00</ns0:published>
<ns0:title type="html">BLOGGER TITLE</ns0:title>
</ns0:entry>
</ns0:feed>

4. Cấu trúc bài viết trên file XML với nhiều Category, Entry:


<?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='demo 1'/>
<ns0:category scheme='http://www.blogger.com/atom/ns#' term='demo'/>
<ns0:id>BLOGGER TEST 1</ns0:id>
<ns0:content type="html">Blogger CONTENT 1</ns0:content>
<ns0:published>2013-10-29T04:22:00.001-07:00</ns0:published>
<ns0:title type="html">BLOGGER TITLE 1</ns0:title>
</ns0:entry>

<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='demo 2'/>
<ns0:category scheme='http://www.blogger.com/atom/ns#' term='demo'/>
<ns0:id>BLOGGER TEST 2</ns0:id>
<ns0:content type="html">Blogger CONTENT 2</ns0:content>
<ns0:published>2013-11-29T03:22:00.001-07:00</ns0:published>
<ns0:title type="html">BLOGGER TITLE 2</ns0:title>
</ns0:entry>

</ns0:feed>
– Như vậy, nếu hiểu rõ được cấu trúc trên, chúng ta có thể hoàn toàn import được một số lượng bài viết khổng lồ với thời gian được lập lịch sẵn và ngẫu nhiên post vài từng giờ, từng ngày…Với tính năng như vậy sẽ đảm bảo cho việc post bài đều đặn, điều độ trên Blogspot –>> rất tốt cho SEO.
Blog tổng hợp những kinh nghiệm được học, áp dụng và chia sẻ
Previous Post
Next Post
Related Posts

0 nhận xét: