Dashboard

find('div[class=pagination] ul li') as $ul) { if($element = 1) { foreach($ul->find('a') as $a) { $nr = $a->innertext; if (!in_array($nr, $pageNr) && is_numeric($nr)) { $pageNr[] = $nr; } } } $element++; } } $numberOfPages = max($pageNr); for ($i = 0; $i < ($numberOfPages + 1); $i++) { sleep (rand(2, 4)); $words=array(); $urlStart = 'http://www.mijnwoordenboek.nl/duits/synoniemen/' . $letter . '/' . $i . '.html'; $htmlLetters = file_get_html($urlStart); $element = 0; foreach($htmlLetters->find('div[class=content_box] div div div[style=clear:both;] div[style=float:left;margin-right:25px]') as $ul) { if($element = 1) { foreach($ul->find('a') as $a) { $word = $a->innertext; if (!in_array($word, $words)) { $words[] = $word; } echo $word . '
'; } } $element++; } foreach($words as $word) { $checkWord = mysqli_query($con, "SELECT word FROM Words_DE WHERE word='$word'"); if($checkWord && $checkWord->num_rows){ //echo $word . ' already exists.
'; } else { mysqli_query($con, "INSERT INTO Words_DE (word) VALUES ('$word')"); } } } echo 'KLAAR!'; // FASE 2: synoniemen vanuit database ophalen en updaten bij betreffend woord $time_start = microtime(true); // Get synonyms from database words and as JSON $getWords = mysqli_query($con, "SELECT * FROM Words_DE LIMIT 0,10"); // tot 37222 while($row = $getWords->fetch_assoc()) { sleep (rand(1, 2)); $databaseWord = $row["word"]; $databaseWordId = $row["id"]; $synonyms = array(); $urlStart = 'http://www.mijnwoordenboek.nl/duits/synoniemen/' . str_replace(' ', '%20', $databaseWord); //echo 'Woord: ' . $databaseWord . '
' . 'url: ' . $urlStart . '
'; $getSynonyms = file_get_html($urlStart); $i = 0; foreach($getSynonyms->find('ul[class=icons-ul]') as $ul) { if($i === 0) { foreach($ul->find('a') as $a) { $word = $a->innertext; if (!in_array($word, $synonyms)) { $synonyms[] = $word; } } //print_r($synonyms); $toJSON = json_encode($synonyms, JSON_UNESCAPED_UNICODE); //echo $toJSON; //print_r($toJSON); mysqli_query($con,"UPDATE Words_DE SET synonyms = '$toJSON' WHERE word = '$databaseWord'"); //echo $databaseWord; $i++; } } } echo '
'; $time_end = microtime(true); $execution_time = ($time_end - $time_start)/60; echo 'Total Execution Time: '.$execution_time.' Mins'; ?>
Original text



Synonyms



Text adjustments

Changed:

Text to copy

copy


Top 10 keywords