X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f6a76ebcd5c255eaa8e674c5176ef29690a7f66c..96c1a0a101164834a79333d4f30067d87c4068d9:/utils/importWikipedia.php diff --git a/utils/importWikipedia.php b/utils/importWikipedia.php old mode 100755 new mode 100644 index b767adb3..2e256e35 --- a/utils/importWikipedia.php +++ b/utils/importWikipedia.php @@ -1,7 +1,5 @@ -#!/usr/bin/php -Cq connect(); if ($aCMDResult['drop-tables']) { @@ -306,10 +305,12 @@ function _templatesToProperties($aTemplates) } if (isset($aCMDResult['parse-wikipedia'])) { - $oDB =& getDB(); + $oDB = new Nominatim\DB(); + $oDB->connect(); + $sSQL = 'select page_title from content where page_namespace = 0 and page_id %10 = '; $sSQL .= $aCMDResult['parse-wikipedia']; - $sSQL .= ' and (page_content ilike \'%{{Coord%\' or (page_content ilike \'%lat%\' and page_content ilike \'%lon%\'))' + $sSQL .= ' and (page_content ilike \'%{{Coord%\' or (page_content ilike \'%lat%\' and page_content ilike \'%lon%\'))'; $aArticleNames = $oDB->getCol($sSQL); /* $aArticleNames = $oDB->getCol($sSQL = 'select page_title from content where page_namespace = 0 and (page_content ilike \'%{{Coord%\' or (page_content ilike \'%lat%\' @@ -368,7 +369,9 @@ function nominatimXMLEnd($hParser, $sName) if (isset($aCMDResult['link'])) { - $oDB =& getDB(); + $oDB = new Nominatim\DB(); + $oDB->connect(); + $aWikiArticles = $oDB->getAll("select * from wikipedia_article where language = 'en' and lat is not null and osm_type is null and totalcount < 31 order by importance desc limit 200000"); // If you point this script at production OSM you will be blocked