以编程方式确定CMS通过网址 [英] Programmatically Identify CMS by URL

查看:121
本文介绍了以编程方式确定CMS通过网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何其他的方式来从URL检测CMS?如果是的话,是否有o任何其他语言PHP任何可用的API?
该网站 http://whatcms.org/ 是什么,我心目中的例子;它是如何做检测?

Is there any other way to detect CMS from URL? If yes, is there any available API in PHP o any other language? The site http://whatcms.org/ is an example of what i have in mind; how does it do the detection?

推荐答案

您可以检查生成的元标记。
大多数CMS有自己的名称和版本广告在那里。

You could check the meta tag for generator. Most CMS have their name and version advertised there.

这是你在标记。

<meta name="generator" content="Joomla! - Open Source Content Management" />

这code会设法找出标签提取内容属性。

This code will try and find the tag to extract the content attribute.

$doc = new DOMDocument();
$doc->loadHTMLFile('http://joomla.org');
$xpath = new DOMXPath($doc);

$generators = $xpath->query('//html/head/meta[@name="generator"]');

echo $generators->item(0)->getAttribute('content');

这code回声的的Joomla! - 开源内容管理

这篇关于以编程方式确定CMS通过网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆