<?
require('IXR_Library.inc.php');
$file_of_login='login.txt';
$file_text='text.txt';
$file_zagolovok = 'zagolovok.txt';
$array_text=file($file_text);
$array_zagolovok=file($file_zagolovok);
$login_array=file($file_of_login);
$taglist='tag, tag, tag';
$schet=count($login_array);
$i=0;
while ($i<$schet){
list($a0, $a1) = explode(":",trim($login_array[$i]));
$l_p[$i] = array($a0, $a1);
define('LJ_HOST', 'www.livejournal.com');
define('LJ_PATH', '/interface/xmlrpc');
define('LJ_LOGIN', $l_p[$i][0]);
define('LJ_PASSWD', $l_p[$i][1]);
$ljClient = new IXR_Client(LJ_HOST, LJ_PATH);
if (!$ljClient->query('LJ.XMLRPC.getchallenge')) {
echo 'Ошибка [' . $ljClient->getErrorpre().'] '.$ljClient->getErrorMessage();
}else{
$ljResponse = $ljClient->getResponse();
$ljChallenge = $ljResponse['challenge'];
$ljArgs = array();
$ljArgs['username'] = LJ_LOGIN;
$ljArgs['auth_method'] = 'challenge';
$ljArgs['auth_challenge'] = $ljChallenge;
$ljArgs['auth_response'] = md5($ljChallenge . md5(LJ_PASSWD));
$ljArgs['ver'] = "1";
$ljArgs['event'] = iconv('windows-1251', 'UTF-8', $array_text[$i]);
$ljArgs['subject'] = iconv('windows-1251', 'UTF-8', $array_zagolovok[$i]);
$ljArgs['year']=date('Y',(time()+($time_difference*3600)));
$ljArgs['mon']=date('m',(time()+($time_difference*3600)));
$ljArgs['day']=date('d',(time()+($time_difference*3600)));
$ljArgs['hour']=date('H',(time()+($time_difference*3600)));
$ljArgs['min']=date('i',(time()+($time_difference*3600)));
$ljArgs['props']= array(
'opt_preformatted' => true,
'opt_backdated' => true,//
'taglist' => iconv('windows-1251', 'UTF-8', $taglist),
);
$ljArgs['security'] = 'public';
$ljMethod = 'LJ.XMLRPC.postevent';
if (!$ljClient->query($ljMethod, $ljArgs)) {
echo 'Ошибка ['.$ljClient->getErrorCode().'] '.$ljClient->getErrorMessage();
}else{
$ljResponse = $ljClient->getResponse();
echo $ljResponse."<br/>";
}}
$i++;
}
?>
Экспериментировал с while и с for, но смысл происходящего не меняется…
Подскажите в чём проблема и где обшибся.