$root; $host; $links; $ds; $categoryid; $logService; $level; $start; $error; $logService = new LogDataService(); require_once '..\\d4server\\nodemanager_data_service.php'; $ds = new PovDataService($conf['dsn'], $conf['dbname'], $conf['dbpassword'], array(PDO::ATTR_PERSISTENT => false)); //$lastTimestamp=$ds->getD4CrawlerTimestamp(); $nmDataService = new NodemanagerDataService($conf['d4nmdsn'], $conf['d4nmdbname'], $conf['d4nmdbpassword'], array(PDO::ATTR_PERSISTENT => false)); $forums = $ds->getAllForums(); $logService->log('D4CRAWLER', 'Forums length=' . sizeof($forums), var_log($forums, '$forums'), 'd4crawler'); foreach ($forums as $forum) { $logService->log('D4CRAWLER', 'Starting forum=' . $forum['forum'], var_log($forum, '$forum'), 'd4crawler'); $forumid = $forum['forumid']; $categoryid = $forum['categoryid']; $lastCrawled = $forum['last_crawled']; $d4ds = $nmDataService->getForumHubDataService($forumid); $threads = $d4ds->getNewThreads($forumid, $lastCrawled); $createdat = 0; foreach ($threads as $t) { $url = $t['url']; $exist = $ds->getThreadByUrl($url); if (!$exist) { $current_createdat = $t['createdat']; if ($current_createdat > $createdat) { $createdat = $current_createdat;
$lang = substr($_GET['lang'], 0, 2); $lang_was_set = true; } $logService = new LogDataService(); $user_agent = $_SERVER['HTTP_USER_AGENT']; $server = $_SERVER['SERVER_NAME']; if (stripos($server, 'newsline') !== FALSE) { $productname = "Newsline World"; } else { $productname = "Qwiket"; } //$logService->log('TRACE','LANDING PAGE',$user_agent,'start'); if (isset($_GET['logout'])) { setcookie('identity', '', time() - 3600, '/'); setcookie('ti', '', time() - 24 * 3600, '/'); $logService->log('TRACE', 'LANDING PAGE LOGOUT ', var_log($_GET, '$_GET') . var_log($_COOKIE, '$_COOKIE'), ''); header('Location:/'); exit; } $dynamic_script = "\n\tvar server={\n\t\tidentity:''\n\n\t};\n\n"; $identity = ''; if (isset($_GET['reset'])) { setcookie('identity', $identity, time() + 30 * 24 * 3600, '/'); exit; } $meta_tags = ''; $identity = ''; if (isset($_COOKIE['identity'])) { $identity = $_COOKIE['identity']; } $l = '';
*/ if ($l && !$lang) { $lang = $l; } else { if ($lang && (!$l || $lang != $l)) { setcookie('lang', $lang, time() + 30 * 24 * 3600, '/'); } } if (!$lang) { $lang = 'ENG'; } $t = microtime(TRUE) * 1000000; try { $response = ''; if ($task != 'tick') { $logService->log('TRACE', 'ENTRY API ' . $task, var_log($_GET, '$_GET') . var_log($_COOKIE, '$_COOKIE') . var_log($control, '$control') . var_log($forumid, '$forumid') . var_log($user_agent, '$user_agent'), $identity); } switch ($task) { case 'load_community_forums': $community = 'pointofviewworld'; if (isset($_REQUEST['community'])) { $community = $_REQUEST['community']; } loadCommunityForums($community); break; case 'get_d4_status': $threadid = 0; if (isset($_REQUEST['url'])) { $url = $_REQUEST['url']; } $forum = '';
$view = $_GET['view']; } $lang = 'en'; $lang_was_set = false; if (isset($_GET['lang'])) { $lang = substr($_GET['lang'], 0, 2); $lang_was_set = true; $lang = strtolower($lang); } $logService = new LogDataService(); $user_agent = $_SERVER['HTTP_USER_AGENT']; $server = $_SERVER['SERVER_NAME']; if (isset($_GET['logout'])) { setcookie('identity', '', time() - 3600, '/'); setcookie('nodeid', '', time() - 3600, '/'); $logService->log('D4TRACE', 'LANDING PAGE LOGOUT ', var_log($_GET, '$_GET') . var_log($_COOKIE, '$_COOKIE'), ''); header('Location:/'); exit; } $dynamic_script = ' <script id="newsline" type="text/javascript"> var server={ identity:"" }; </script>'; $forumname = 0; if (isset($_GET['f'])) { $forumname = $_GET['f']; } $login = '';
$file = fopen('..\\sitemaps\\' . $name, "w") or die("Unable to open file!"); fwrite($file, $xml_header); foreach ((array) $urls as $u) { $url = $u['url']; $xml = ' <url> <loc>' . $url . '</loc> </url>'; fwrite($file, $xml); } $xml_footer = ' </urlset>'; fwrite($file, $xml_footer); fclose($file); $sitemap = "http://newsline.world/sitemaps/" . $name; $logService->log('DEBUG', 'before Submitting sitemap', $sitemap, 'sitemapper'); require_once 'autoload.php'; /* $client_email = '*****@*****.**'; $private_key = file_get_contents('MyProject.p12'); $scopes = array('https://www.googleapis.com/auth/sqlservice.admin'); $credentials = new Google_Auth_AssertionCredentials( $client_email, $scopes, $private_key ); $client = new Google_Client(); $client->setAssertionCredentials($credentials); if ($client->getAuth()->isAccessTokenExpired()) { $client->getAuth()->refreshTokenWithAssertion();