0
如何通過我的php應用程序傳遞任何網站的URL來拼寫檢查網站? 這種API的任何想法?通過php應用程序進行網站拼寫檢查
如何通過我的php應用程序傳遞任何網站的URL來拼寫檢查網站? 這種API的任何想法?通過php應用程序進行網站拼寫檢查
有一個API可以用於此,它的工作原理 - 它不是谷歌,但它運作良好。如果您對PHP,XML和Javascript有基本的瞭解。你應該可以使用這個API來做任何你可以夢寐以求的事情。
注意:電子郵件地址和網站必須是真實的,用PHP寫的調用。
if (!empty($input))
{
ini_set("user_agent", "somerobot/1.1 (http://somebot.com/; [email protected])");
$spell_url = "http://en.wikipedia.org/w/api.php?format=xml&srnamespace=0&action=query&srlimit=1&list=search&srprop=sectiontitle&srsearch=".urlencode($input);
$s = simplexml_load_file($spell_url);
if ($s)
{
if (isset($s->query->searchinfo['suggestion']))
{
$input = (string)$s->query->searchinfo['suggestion'];
}
}
安裝拼寫檢查程序並將其啓動到臨時下載的文件上。使用您選擇的拼寫檢查器,例如[aspell](http://aspell.net/)。 – hakre 2012-02-10 12:17:43