From dd882be8032a6fdd70e5a943abe78cdd7e34f49e Mon Sep 17 00:00:00 2001 From: Luke Fitzgerald Date: Tue, 27 Jul 2010 09:14:07 -0700 Subject: Merge in Phergie fixes and remove some whitespace --- .../Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php | 17 +++++++++++++---- plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php | Bin 1740 -> 47104 bytes 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'plugins/Irc/extlib/phergie/Phergie/Plugin') diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php index 4b3d29c53..91d375ca6 100644 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php @@ -35,15 +35,24 @@ $xpath = new DOMXPath($doc); $cookies = $xpath->query('//table[@width="90%"]/tr/td[1]/a'); foreach ($cookies as $cookie) { - - $name = str_replace(array('(',')',"\n", 'cookies'), array('','', ' ', 'cookie' ), trim( $cookie->textContent)); + $name = $cookie->textContent; + foreach (range(0, mb_strlen($name) - 1) as $index) { + echo mb_strcut($name, $index, 1), PHP_EOL; + } + $name = str_replace( + array('(',')',"\n", 'cookies'), + array('','', ' ', 'cookie'), + $name + ); + $name = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $name); + $name = trim($name); + $name = rtrim($name, 's'); $link = 'http://en.wikipedia.org' . $cookie->getAttribute('href'); $insert->execute(array($name, $link)); - print 'added ['.$name.'] -> '. $link . PHP_EOL; + echo 'added [' . $name . '] -> '. $link . PHP_EOL; } // Clean up echo 'Cleaning up', PHP_EOL; unlink($file); - diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php index 28f963ad1..364d9a09f 100644 Binary files a/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php and b/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php differ -- cgit v1.2.3-54-g00ecf