Home> CMS Tutorial> DEDECMS> body text

How to automatically update DEDECMS site content to Sina Weibo

藏色散人
Release: 2020-01-09 09:06:02
Original
2049 people have browsed it

How to automatically update DEDECMS site content to Sina Weibo

How to automatically update the content of the DEDECMS site to Sina Weibo?

The content of the DEDECMS site is automatically updated to Sina Weibo

Recommended learning:梦Weavercms

Sina Weibo uses feed to find updated articles. Just specify the feed address for him and he can be successfully associated.

Now let’s start with a simple modification of Dreamweaver’s template. Since Dreamweaver cannot generate the entire site’s XML file, we must first create a PHP program that generates the entire site’s XML.

1. Create feed.php

SetTemplet($cfg_basedir . $cfg_templets_dir . "/feed.htm"); header("Content-type:application/xml"); $pv->Display(); ?>
Copy after login

The above thing to note is to modify the path of the template to ensure that feed.htm can be found in the template and directory

2. Create feed. htm template file

   {dede:global.cfg_webname/} {dede:global.cfg_basehost/} {dede:global.cfg_description/} zh-cn {dede:global.cfg_webname/} {dede:global.cfg_adminemail/} {dede:arclist row=’60′ col=’1′ titlelen=’100′ orderby=’pubdate’}  [field:arcurl/] <![CDATA[[field:title function='html2text(@me)'/]]]> [field:writer/] [field:typename/] [field:pubdate function='strftime("%a, %d %b %Y %H:%M:%S +0800",@me)'/] [field:arcurl/]   {/dede:arclist}  
Copy after login

It should be noted that don’t forget to change my URL to what you need.

3. Modify the index.htm home page template

Since Sina Weibo can only verify the URL and cannot write the full path, for example, I wrote:. The result indicates that the association failed. The solution is to add the following code

Copy after login

betweenand

. Through the above method, you can successfully associate with Sina Weibo.

The above is the detailed content of How to automatically update DEDECMS site content to Sina Weibo. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!