<?php

require_once "../JentiConfig.php";
require_once "../JentiRequestWiktionary.php";
$request = new JentiRequestWiktionary($config);
$result = $request->get_word("guerra");
//$request->get_web_page("http://it.wiktionary.org/wiki/razionale");
if ($request->error) {
    echo $request->error;
}
echo "<PRE>" . print_r($result, true) . "</PRE>";
$request->debug_echo_dom(null, 0, null, null);
Beispiel #2
0
    echo '<script language="JavaScript" type="text/javascript">' . 'log_write( \'' . str_replace(array('\'', "\n", "\r"), array('"', "", ""), $msg) . '\');' . '</script>';
    for ($k = 0; $k < 50000; $k++) {
        echo ' ';
    }
    echo PHP_EOL;
}
// Turn off output buffering
ini_set('default_socket_timeout', 36000);
ini_set('max_execution_time', 36000);
$words = explode(PHP_EOL, "guerra\ncombattere\nsanguinoso");
$request = new JentiRequestWiktionary($config);
$jenti_word = new JentiWord($config);
ob_implicit_flush(TRUE);
$log = log_open();
foreach ($words as $word) {
    $word_array = $request->get_word($word);
    if ($request->error) {
        echo_msg_flush($request->error);
        log_writeln($log, $request->error);
        continue;
    }
    foreach ($word_array as $word_info) {
        $jenti_word->add_word_and_definitions($word_info);
        if (!$jenti_word->error) {
            echo_msg_flush(print_r($word_info, true));
            log_writeln($log, print_r($word_info, true));
        }
        if ($jenti_word->error) {
            echo_msg_flush($jenti_word->error);
            log_writeln($log, $jenti_word->error);
        }