Mailing jest na free.os.pl - administrator milczy na prośbę zrobienia takiego skryptu.
Do tego dodatku potrzebny jest skrypt.
To są dane ze strony:
1. Login:
<input type="text" tabindex="1" onblur="this.className = 'wm_input';" onfocus="this.className = 'wm_input_focus';" maxlength="255" name="email" id="email" value="" class="wm_input" style="width: 224px; font-size: 12px;">
2. Hasło:
<input type="password" onblur="this.className = 'wm_input wm_password_input';" onfocus="this.className = 'wm_input_focus wm_password_input';" maxlength="255" name="password" id="password" value="" class="wm_input wm_password_input" style="width: 224px; font-size: 12px;" tabindex="3">
a to mój skrypt:
Kod
// JavaScript Document
function initHandler(handler){
handler.name="MyMail";
this.dataURL="http://free.os.pl";
this.loginData=["http://free.os.pl/index.php?mode=submit","name","password","key="+encodeURIComponent("abc=12")];
this.mailURL="http://free.os.pl";
}
function getCount(aData){ //aData is a html source in dataURL
var fnd=aData.match(/\"folders\":\[{\"id\":1.+?\"unread\":(\d+)/); //find mail count
if(fnd){
var num;
//get mail count here
return num;
}else{
return -1;//display 'not checked' message
}
}
function initHandler(handler){
handler.name="MyMail";
this.dataURL="http://free.os.pl";
this.loginData=["http://free.os.pl/index.php?mode=submit","name","password","key="+encodeURIComponent("abc=12")];
this.mailURL="http://free.os.pl";
}
function getCount(aData){ //aData is a html source in dataURL
var fnd=aData.match(/\"folders\":\[{\"id\":1.+?\"unread\":(\d+)/); //find mail count
if(fnd){
var num;
//get mail count here
return num;
}else{
return -1;//display 'not checked' message
}
}
oraz przerobiony gotowy skrypt interia.pl
Kod
var name="INTERIA.PL";
var ver="2010-11-12";
function init(){
this.initStage=ST_PRE;
this.loginData=["http://free.os.pl/index.php?mode=submit","email","password"];
this.dataURL="http://free.os.pl";
this.mailURL="http://free.os.pl";
this.mailDomain="free.os.pl";
}
function getCount(aData){
var fnd=aData.match(/\"folders\":\[{\"id\":1.+?\"unread\":(\d+)/);
if(fnd){
return fnd[1];
}else{
fnd=aData.match(/Odebrane<\/a>.+?\((?:(\d+)\/)?\d+?\)/);
if(fnd)return fnd[1]?fnd[1]:0;
else return -1;
}
}
function process(aHttpChannel, aData) {
switch(this.stage){
case ST_PRE:
this.stage=ST_LOGIN;
this.getHtml("http://free.os.pl/");
return true;
}
return this.baseProcess(aHttpChannel, aData);
}
var ver="2010-11-12";
function init(){
this.initStage=ST_PRE;
this.loginData=["http://free.os.pl/index.php?mode=submit","email","password"];
this.dataURL="http://free.os.pl";
this.mailURL="http://free.os.pl";
this.mailDomain="free.os.pl";
}
function getCount(aData){
var fnd=aData.match(/\"folders\":\[{\"id\":1.+?\"unread\":(\d+)/);
if(fnd){
return fnd[1];
}else{
fnd=aData.match(/Odebrane<\/a>.+?\((?:(\d+)\/)?\d+?\)/);
if(fnd)return fnd[1]?fnd[1]:0;
else return -1;
}
}
function process(aHttpChannel, aData) {
switch(this.stage){
case ST_PRE:
this.stage=ST_LOGIN;
this.getHtml("http://free.os.pl/");
return true;
}
return this.baseProcess(aHttpChannel, aData);
}
Obydwa skrypty nie działają (otwiera się strona mailingu lecz nie loguje się). Nie jestem profesjonalistą dopiero zaczynam więc proszę o jakąkolwiek pomoc lub wskazówki.