Ребят, а никто не пользуется случайно мобильным провайдером
http://www.ncc-volga.ru/ ?
Помогите плиз с небольшим скриптом проверки баланса.
Исходный код формы входа в iSERVE
<form method="post" action="?path=iserv" name="form1" enctype="application/x-www-form-urlencoded">
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td class="icons" colspan="7" height="15"><img src="/templates/iserve/images/b-trans.gif" width="13" height="13" /></td>
</tr>
<tr valign="top">
<td class="icons" valign="middle">Абонент</td>
<td class="icons"><img src="/templates/iserve/images/b-trans.gif" width="10" height="20" /></td>
<td class="normal" height="20"><input type="text" name="userv" id="userv" class="normal" onChange="focuspwd()"
style="width:86px" size="7" tabindex="1" />
</td>
<td class="normal"><img src="/templates/iserve/images/b-trans.gif" width="10" height="20" /></td>
<td class="normal"><a href="javascript:doSubmit(); void(0);" tabindex="3" onmouseover="document.images['enter'].src='/templates/iserve/images/i-enter2.gif'" onmouseout="document.images['enter'].src='/templates/iserve/images/i-enter.gif'"> <img src="/templates/iserve/images/i-enter.gif" alt="Вход" name="enter" width="20" height="20" border="0" id="enter" /></a></td>
<td class="normal"><img src="/templates/iserve/images/b-trans.gif" width="10" height="20" /></td>
<td class="normal"><a href="javascript:doSubmit(); void(0);" tabindex="4" class="icons" onmouseover="document.images['enter'].src='/templates/iserve/images/i-enter2.gif'" onmouseout="document.images['enter'].src='/templates/iserve/images/i-enter.gif'">Вход</a></td>
</tr>
<tr valign="top">
<td class="icons" colspan="7"><img src="/templates/iserve/images/b-trans.gif" width="10" height="5" /></td>
</tr>
<tr valign="top">
<td class="icons" height="20" valign="middle">Пароль</td>
<td class="icons" height="20"><img src="/templates/iserve/images/b-trans.gif" width="10" height="20" /></td>
<td class="normal" height="20"><input type="password" name="passv" id="passv" class="normal" style="width:86px"
size="7" tabindex="2" AUTOCOMPLETE="off"/></td>
<td class="normal"><img src="/templates/iserve/images/b-trans.gif" width="10" height="20" /></td>
<td class="normal"><a href="?path=demo" onmouseover="document.images['enterguest'].src='/templates/iserve/images/i-enterguest2.gif'" onmouseout="document.images['enterguest'].src='/templates/iserve/images/i-enterguest.gif'" tabindex="5"> <img src="/templates/iserve/images/i-enterguest.gif" alt="Демо" name="enterguest" width="20" height="20" border="0" id="enterguest" /></a></td>
<td class="normal"><img src="/templates/iserve/images/b-trans.gif" width="5" height="20" /></td>
<td class="normal"><a href="?path=demo&chap=sms" class="icons" onmouseover="document.images['enterguest'].src='/templates/iserve/images/i-enterguest2.gif'" onmouseout="document.images['enterguest'].src='/templates/iserve/images/i-enterguest.gif'" tabindex="6">Демо</a></td>
</tr>
</table></form>
И сама страничка,
https://iserve.ncc-volga.ru/?path=sms, с которой можно забрать инфу.
Исходный код:
<tr>
<td width="6" align="left" valign="top" bgcolor="#EB891B"><img src="/templates/city/images/b-trans.gif" width="6" height="78" /></td>
<td width="9" height="78" align="right" valign="top" bgcolor="#EB891B"><img src="/templates/city/images/b-trans.gif" width="6" height="78" /></td>
<td align="left" valign="top" bgcolor="#EB891B"><table width="100%" border="0">
<tr>
<td class="icons">Номер:</td>
<td class="icons">908*******</td>
<td class="icons">Баланс:</td>
<td class="icons">102,05 руб.</td>
</tr>
<tr>
<td class="icons">Филиал:</td>
<td class="icons">Чувашская Республика</td>
<td class="icons">Бонус:</td>
<td class="icons">0,00 руб.</td>
</tr>
</table></td>
Нужно всего вырвать "102,05 руб."
#!/bin/sh
LOGIN=""
PASSWORD=""
request()
{
wget \
--load-cookies cookies.txt \
--save-cookies cookies.txt \
--keep-session-cookies \
--quiet \
$@
}
request -O 1.html \
'https://iserve.ncc-volga.ru/?path=sms'
request -O 2.html \
--post-data="userv=$LOGIN&passv=$PASSWORD" \
'https://iserve.ncc-volga.ru/?path=logon'
sed -ne '/Баланс:/ { s,.*>\([0-9.]*\)</.*$,\1,; p }' <2.html
Взял тут
http://habrahabr.ru/blogs/sysadm/114177/Попробовать чуть переделать, но как-то не особо, ничего не вышло получить.
