如何用PHP把RDF内容插入Web站点之中(1)
1)名誉和巨大的财富
设想一个从最热门的门户网站获得最新的新闻的站点。股票价格,天气信息,新闻故事,线式讨论组,软件发布……所有这一切都将被动态更新,每小时一次,不需要任何手工干预。我们可以想象这随之而来的站点访问量,源源不断的广告收入以及网管大人所受到的“阿谀奉承”。
但是现在,停止幻想,开始阅读,因为只要你密切关注此项技术,说不定你就能成为站点的主人。 对你的要求也只是稍许的想象力,一些聪明的PHP编码和几个免费的RSS文件。另外,很明显还包括这篇文章剩下的九个部分。
2)有内容,就联合成辛迪加(Have Content, Will Syndicate)
我们从最基本的开始——那么RSS究竟是什么鬼东西呢?
RSS(即RDF Site Summary)是一种格式,最早由Netscape公司设计,用于分发其门户站点My.Netscape.Com上的内容的描述信息。自1997年被提出以来,几经沉浮——可以点击文章末尾的链接,了解一下RSS悠久复杂的历史。现在的稳定的版本是RSS1.0,符合RDF规范。这一版本可以说即轻便又功能齐全。
RSS使得网管及时公布和分发某一特定站点的特定位置的最新最有趣的内容的描述信息变的可能。 从新闻文章列表到股票市场数据或着是天气预报,所有这些信息都可以通过结构良好的XML文档来发布,从而也可以被任何XML分析器进行分析,处理和翻译。
网站上最新信息的列表是经常更新的,而RSS使得这一列表的分发成为可能,也就为Web上简易的内容辛迪加联合打开了大门。想了解这其中的道理,请看下面这个简单的例子:
站点A,属新闻站点(“内容辛迪加组织者”),能够每小时发布一个包含最新新闻列表以及相应链接的RSS文档。 而这一RSS文档可以被其它站点获取(如站点B,“内容收集者”),分析并显示在站点B的索引页面上。 每次站点A发布一个新的RSS文档,站点B的索引页面都可以自动更新,以获取最新的新闻。
这种方案对交易中的双方机构都有效。 既然RSS文档中的链接都指向站点A上相应的文章,那么站点A将迅速体验到访问量的增加。 而站点B的网管可以休假一个星期,因为他有办法自动更新其站点上的索引页面,而这一方法仅仅是把索引页面与站点A发布的动态内容相连接而已。
有许多受欢迎的站点向公众提供详细的RSS或RDF新闻,如Freshmeat(http://www.freshmeat.net)和Slashdot(http://www.slashdot.org),当然还有其它许多站点。在这篇文章当中,我将广泛的使用Freshmeat网站的RDF文件。需要说明的一点是,这里所谈到的技术也可以应用于其它任何RSS1.0或RDF文件。
3)交换频道(Switching Channels)
典型的RSS文档包含一个由描述性元数据标记出来的资源列表(URLs),请看下面的例子:
rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/">
tutorials on Web technologies
http://www.melonfire.com/community/columns/trog/
rdf:Seq>
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=100" />
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=71" />
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=62" />
rdf:Seq>
d=10
0">
http://www.melonfire.com/community/columns/trog/article.php?id=100
li
nk>
work? Find out here.
d=71">
http://www.melonfire.com/community/columns/trog/article.php?id=71/link>
generate HTML pages.
d=62">
http://www.melonfire.com/community/columns/trog/article.php?id=62/link>
with the mySQL grant tables.
你可以看到,RDF文件由几个界限分明的部分组成。首先是文档序码(prolog),
xml version="1.0" encoding="UTF-8"?>
然后是根元素中的名称空间声明。
rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/">
接着是
tutorials on Web technologies
http://www.melonfire.com/community/columns/trog/
rdf:Seq>
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=100" />
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=71" />
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=62" />
rdf:Seq>
items>
rdf:Seq>
li
rdf:resource="http://www.melonfire.com/community/columns/trog/article.ph
p?id
=100" />

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

HTTP status code 520 means that the server encountered an unknown error while processing the request and cannot provide more specific information. Used to indicate that an unknown error occurred when the server was processing the request, which may be caused by server configuration problems, network problems, or other unknown reasons. This is usually caused by server configuration issues, network issues, server overload, or coding errors. If you encounter a status code 520 error, it is best to contact the website administrator or technical support team for more information and assistance.

HTTP status code 403 means that the server rejected the client's request. The solution to http status code 403 is: 1. Check the authentication credentials. If the server requires authentication, ensure that the correct credentials are provided; 2. Check the IP address restrictions. If the server has restricted the IP address, ensure that the client's IP address is restricted. Whitelisted or not blacklisted; 3. Check the file permission settings. If the 403 status code is related to the permission settings of the file or directory, ensure that the client has sufficient permissions to access these files or directories, etc.

How to use NginxProxyManager to implement automatic jump from HTTP to HTTPS. With the development of the Internet, more and more websites are beginning to use the HTTPS protocol to encrypt data transmission to improve data security and user privacy protection. Since the HTTPS protocol requires the support of an SSL certificate, certain technical support is required when deploying the HTTPS protocol. Nginx is a powerful and commonly used HTTP server and reverse proxy server, and NginxProxy

Why Snipping Tool Not Working on Windows 11 Understanding the root cause of the problem can help find the right solution. Here are the top reasons why the Snipping Tool might not be working properly: Focus Assistant is On: This prevents the Snipping Tool from opening. Corrupted application: If the snipping tool crashes on launch, it might be corrupted. Outdated graphics drivers: Incompatible drivers may interfere with the snipping tool. Interference from other applications: Other running applications may conflict with the Snipping Tool. Certificate has expired: An error during the upgrade process may cause this issu simple solution. These are suitable for most users and do not require any special technical knowledge. 1. Update Windows and Microsoft Store apps

Understand the meaning of HTTP 301 status code: common application scenarios of web page redirection. With the rapid development of the Internet, people's requirements for web page interaction are becoming higher and higher. In the field of web design, web page redirection is a common and important technology, implemented through the HTTP 301 status code. This article will explore the meaning of HTTP 301 status code and common application scenarios in web page redirection. HTTP301 status code refers to permanent redirect (PermanentRedirect). When the server receives the client's

Use the http.PostForm function to send a POST request with form data. In the http package of the Go language, you can use the http.PostForm function to send a POST request with form data. The prototype of the http.PostForm function is as follows: funcPostForm(urlstring,dataurl.Values)(resp*http.Response,errerror)where, u

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files With the development of the Internet, the file download function has become one of the basic needs of many websites and applications. For scenarios where multiple files need to be downloaded at the same time, the traditional synchronous download method is often inefficient and time-consuming. For this reason, using PHP to download multiple files asynchronously over HTTP has become an increasingly common solution. This article will analyze in detail how to use PHP asynchronous HTTP through an actual development case.
