From 833537692e62db2a7dea1c9eb74b79c5311fc39b Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 9 May 2016 21:39:18 +0200 Subject: Move URL title method to dedicated class --- www/ajaxGetTitle.php | 50 ++++---------------------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) (limited to 'www/ajaxGetTitle.php') diff --git a/www/ajaxGetTitle.php b/www/ajaxGetTitle.php index e1fbe30..b95e29b 100644 --- a/www/ajaxGetTitle.php +++ b/www/ajaxGetTitle.php @@ -27,53 +27,11 @@ require_once 'www-header.php'; /* Managing all possible inputs */ isset($_GET['url']) ? define('GET_URL', $_GET['url']): define('GET_URL', ''); +$urlhelper = new SemanticScuttle_UrlHelper(); -function getTitle($url) { - $fd = @fopen($url, 'r'); - if ($fd) { - $html = fread($fd, 1750); - fclose($fd); - - // Get title from title tag - preg_match_all('/