Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]WebMail Notifier, Prośba o sprawdzenie skryptu
MESSIAH :)
post 21.02.2012, 15:12:48
Post #1





Grupa: Zarejestrowani
Postów: 249
Pomógł: 0
Dołączył: 22.12.2011

Ostrzeżenie: (10%)
X----


Mam zainstalowany dodatek do mozilli WebMail Notifier - który sprawdza mailing.
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:
  1. <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:
  1. <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
}
}


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);
}


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.


--------------------
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
nospor
post 21.02.2012, 15:14:24
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




zapytaj gościa z tego tematu:
http://forum.php.pl/index.php?showtopic=19...mp;#entry942353
mial identyczny problem


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 07:25