コード例 #1
0
$wpapi = new wikipediaapi('', '', '', $bot, $wiki, true);
$wpq = new wikipediaquery('', '', '', $bot, $wiki, true);
$wpi = new wikipediaindex('', '', '', $bot, $wiki, true);
$user = getWikibotSetting('user', $bot, $wiki);
$pass = getWikibotSetting('pass', $bot, $wiki);
$host = getWikibotSetting('host', $bot, $wiki);
$port = getWikibotSetting('port', $bot, $wiki);
$nick = getWikibotSetting('nick', $bot, $wiki);
$ident = getWikibotSetting('ident', $bot, $wiki);
$realname = getWikibotSetting('realname', $bot, $wiki);
$chan = getWikibotSetting('chan', $bot, $wiki);
$deleteLine = getWikibotSetting('deleteline', $bot, $wiki);
$moveLine = getWikibotSetting('moveline', $bot, $wiki);
$deletedWord = getWikibotSetting('deletedword', $bot, $wiki);
$newCharacter = getWikibotSetting('thenewcharacter', $bot, $wiki);
if ($wpapi->login($user, $pass) != 'true') {
    echo "Login failure\n";
    die;
}
$readbuffer = "";
$startSep = "[[";
$endSep = "]]";
// open a socket connection to the IRC server
$fp = fsockopen($host, $port, $erno, $errstr, 30);
// print the error if there is no connection
if (!$fp) {
    echo $errstr . " (" . $errno . ")<br />\n";
    die;
}
// write data through the socket to join the channel
fwrite($fp, "NICK " . $nick . "\r\n");
コード例 #2
0
// This file uses the global mysql connection.
// Do not use this code with other code that uses mysql.
// =============== WARNING ===============
ini_set('memory_limit', '1512M');
/**
 * Script for converting the mapping database to wiki templates.
 */
include '../databaseconfig.php';
require_once 'wikibot.classes.php';
// information about classes and properties
$classFile = "classes/classes";
$end = ".html";
$propertyFile = "properties.txt";
$token = "";
$w = new wikipediaapi();
echo $w->login($luser, $lpass);
$page = PREFIX . 'Actor';
$data = "test";
echo $w->edit($page, $data, $summary = 'ddd');
die;
//$token = login($mwuser, $mwpass);
/*
print_r($token);
die;
*/
// actual mappings
$mappingsFile = "mappings.txt";
//$baseURL = 'http://meta.wikimedia.org/wiki/DBpedia/ontology/';
$dbname = 'dbpedia_extraction_en';
//$baseURL = 'http://meta.wikimedia.org/w/index.php?title=DBpedia/ontology/';
$link = mysql_connect($host, $user, $password) or die("couldnt connect");