From 09dbbdcd142d3538858cbd086fa57d2d4f04bc07 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 16 Oct 2014 12:47:49 +0200 Subject: loading url normalizers now via Lua mechano --- src/crawl/crawl.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/crawl/crawl.cpp b/src/crawl/crawl.cpp index 1b409bc..7d6622e 100755 --- a/src/crawl/crawl.cpp +++ b/src/crawl/crawl.cpp @@ -100,31 +100,24 @@ int main( int /* argc */, char *argv[] ) vector entries = directory_entries( modulePath, true, modulesSearchRecursive ); vector modules = luaVm.getStringArray( "modules.urlnormalizers" ); + vector normalizerModules; vector::const_iterator it2, end2 = modules.end( ); for( it2 = modules.begin( ); it2 != end2; it2++ ) { #ifndef _WIN32 - string module = (*it2) + ".so"; + string module = *it2 + ".so"; #else - string module = (*it2) + ".dll"; + string module = *it2 + ".dll"; #endif cout << "Searching for module '" << module << "'" << endl; vector::const_iterator it, end = entries.end( ); for( it = entries.begin( ); it != end; it++ ) { - if( endswith( (*it), module ) ) { - cout << " Found in file '" << (*it) << "'" << endl; + if( endswith( *it, module ) ) { + cout << " Found in file '" << *it << "'" << endl; + normalizerModules.push_back( *it ); } } } - - vector normalizerModules; -#ifndef _WIN32 - normalizerModules.push_back( "./modules/urlnormalizer/simpleurl/mod_urlnormalizer_simple.so" ); - normalizerModules.push_back( "./modules/urlnormalizer/googleurl/mod_urlnormalizer_googleurl.so" ); -#else - normalizerModules.push_back( ".\\modules\\urlnormalizer\\simpleurl\\mod_urlnormalizer_simple.dll" ); - normalizerModules.push_back( ".\\modules\\urlnormalizer\\googleurl\\mod_urlnormalizer_googleurl.dll" ); -#endif ModuleLoader urlNormalizers( normalizerModules, CLOSE_DEFERRED, (void *)&luaVm ); // initialize crawler function -- cgit v1.2.3-54-g00ecf