If you can make good use of Weibo as a tool in the website promotion process, it will bring great benefits to the website promotion work. Come to huge convenience. Let's take the dede program as an example to explain how to automatically synchronize website content to Sina Weibo.
There is a function in the Sina Weibo tool to automatically associate blogs. If you make good use of this function, the newly published content on the website will be automatically synchronized to the Sina blog. As shown below:
Before using this function, you need to create the RSS feed of your website in advance. Let’s take dede as an example to explain how to create the RSS feed of the website.
Create a new feed.php file with the code as shown below. After saving, upload this file to the root directory of your website.
<?php require_once (dirname(__FILE__) . "/include/common.inc.php"); require_once DEDEINC."/arc.partview.class.php"; $pv = new PartView(); $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/default/feed.htm"); header("Content-type:application/xml"); $pv->Display(); ?>
Create a new feed.htm file with the code as shown below. Upload this file to dede's template directory.
<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>{dede:global.cfg_webname/}</title> <link>{dede:global.cfg_basehost/}</link> <description>{dede:global.cfg_description/}</description> <language>zh-cn</language> <generator>{dede:global.cfg_webname/}</generator> <webmaster>{dede:global.cfg_adminemail/}</webmaster> {dede:arclist row='60' col='1' titlelen='100' orderby='pubdate'} <item> <link>http://www.ijinfa.cn[field:arcurl/]</link> <title><![CDATA[[field:title function='html2text(@me)'/]]]></title> <author>[field:writer/]</author> <category>[field:typename/]</category> <pubDate>[field:pubdate function='strftime("%a, %d %b %Y %H:%M:%S +0800",@me)'/]</pubDate> <guid>http://www.ijinfa.cn[field:arcurl/]</guid> <description><![CDATA[[field:description function='html2text(@me)'/] … ]]></description> </item> {/dede:arclist} </channel> </rss>
Finally, add the following statement between
in the index.htm template file:<span class="sh_symbol"><link rel<span class="sh_symbol">=<span class="sh_string">"alternate" type<span class="sh_symbol">=<span class="sh_string">"application/rss+xml" href<span class="sh_symbol">=<span class="sh_string">"http://www.ijinfa.cn/feed.php" title<span class="sh_symbol">=<span class="sh_string">"你的网站名称" <span class="sh_symbol">/> </span></span></span></span></span></span></span></span></span></span>
Regenerate the website homepage in the dede background, so that the RSS feed of your website has been created.