如何检测其博客API [英] How to detect which blog API

查看:95
本文介绍了如何检测其博客API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设你想创建一个死的简单BlogEditor和,你的想法之一,就是做Live作家做,并要求只有个人博客网址。你怎么能检测什么类型的博客是什么?

Let's say that you want to create a dead simple BlogEditor and, one of your ideas, is to do what Live Writer does and ask only the URL of the persons Blog. How can you detect what type of blog is it?

基本检测可以与URL本身来完成,如 http://myblog.blogger.com 等等。但是,如果它的自我托管是什么?

Basic detection can be done with the URL itself, such as "http://myblog.blogger.com" etc. But what if it's self hosted?

我对如何做到这一点在Java中最感兴趣的,但这个问题也可以用于作为任​​何其它语言的参考

I'm mostly interested on how to do this in Java, but this question could be also used as a reference for any other language.

推荐答案

许多(大多数?)的博客将有发电机,它会列出博客引擎元标记。例如Blogger博客将包含以下meta标签:

Many (most?) blogs will have a meta tag for "generator" which will list the blog engine. For example a blogger blog will contain the following meta tag:

<meta name="generator" content="Blogger" />

我的潜台词博客显示以下发电机meta标签:

My Subtext blog shows the following generator meta tag:

<meta name="Generator" content="Subtext Version 1.9.5.177" />

这meta标签将首先关注的地方。对于没有在源设置这个元标记的博客,你不得不求助于寻找模式来确定博客的类型。

This meta tag would be the first place to look. For blogs that don't set this meta tag in the source, you'd have to resort to looking for patterns to determine the blog type.

这篇关于如何检测其博客API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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