新浪微博是借助feed找到更新文章的。只须给他指定feed地址就可以成功关联啦。
目前开始动手容易修改一下DEDE的模板,因为DEDE不可以生成全站的xml文件,所以要先打造生成全站XML的php程序。
1,打造feed.php
<?xml version="1.0" encoding="gb2312" ?>
<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>[field:arcurl/]</link>
<title><![CDATA[[field:title function='html2text'/]]]></title>
<author>[field:writer/]</author>
<category>[field:typename/]</category>
<pubDate>[field:pubdate function='strftime'/]</pubDate>
<guid>[field:arcurl/]</guid>
<description><![CDATA[[field:description function='html2text'/] … ]]></description>
</item>
{/dede:arclist}
</channel>
</rss>
应该注意的是,别忘了把我的网址改成你一个人需要的。
3,修改index.htm主页模板
因为新浪微博只能验证网址,不可以写完整路径,譬如我写的是:。结果提示关联失败,解决的方法是,在<head>和</head>中间加入下面的代码
<link rel="alternate" type="application/rss+xml" href="" title="你的标题" />
通过以上办法就可以成功关联新浪微博了。