Code: Select all
bind pub - !www www:www
proc www:www {nick host handle chan text} {
package require http
set a ""
set b ""
set token [http::config -useragent "Mozilla 4.0"]
set url "http://lajt.mine.nu/index.php"
set data [http::geturl $url]
set data2 [http::data $data]
http::cleanup $data
regexp -nocase {<a href="(.*?)">(.*?)</a>} $data2 data2 a b
puthelp "PRIVMSG $chan :$a"
regexp -nocase {<a href="(.*?)">(.*?)</a>} $data2 data2 a b
puthelp "PRIVMSG $chan :$a"
regexp -nocase {<a href="(.*?)">(.*?)</a>} $data2 data2 a b
puthelp "PRIVMSG $chan :$a"
}
Code: Select all
<body bgcolor="gray">
Gott Nytt år 2004!
<br>
<br>
<a href="phpmyadmin/">PHP Myadmin</a>
<br>
<a href="upload/">Upload</a>
<br>
<a href="movies/">Movies</a>
<br>
<br>
<a href="mailto:t3ch@lajt.mine.nu">Kasta ett e-brev!</a>
Code: Select all
phpmyadmin/
upload/
movies/
Code: Select all
phpmyadmin/
Code: Select all
# set this outside the proc, it's safer
package require http
bind pub - !www www:www
proc www:www {nick host handle chan text} {
#why setting these here?
set a ""
set b ""
#what you use this for?
set token [http::config -useragent "Mozilla 4.0"]
set url "http://lajt.mine.nu/index.php"
set data [http::geturl $url]
set data2 [http::data $data]
http::cleanup $data
foreach line [split $data2 \n] {
if {[regexp -nocase {<a href="(.*?)">(.*?)</a>} $line line a b]} {
puthelp "PRIVMSG $chan :$a"
}
}
}
Code: Select all
# set this outside the proc, it's safer
package require http
bind pub - !www www:www
proc www:www {nick host handle chan text} {
#why setting these here?
set a ""
set b ""
#what you use this for?
set token [http::config -useragent "Mozilla 4.0"]
set url "http://lajt.mine.nu/index.php"
set data [http::geturl $url]
set data2 [http::data $data]
http::cleanup $data
foreach line [split $data2 \n] {
if {[regexp -nocase {<a href="(.*?)">(.*?)</a>} $line <---- data2 a b]} {
puthelp "PRIVMSG $chan :$a"
}
}
}
if {[regexp -nocase {<a href="(.*?)">(.*?)</a>} $line line a b]} {
Code: Select all
[string map -nocase {\\ \\\\} $arg]
Code: Select all
string map -nocase {\\ \\\\} $arg
regsub {(\\){2}} $txt {\\\\\\\\} ntxt
Code: Select all
regsub {(\\\\)} $txt {\\\\\\\\} ntxt
Code: Select all
regsub {(\\){2}} $txt {\\\\\\\\} ntxt
Code: Select all
string map {\\\\ \\\\\\\\} $arg
cause the other map is doing \ > \\ but if u use \ it wouldn't work so i must use \\ and replace it with \\\\ so this means output \ => \\the {2} means that it wants exactly 2 matches of \\ to switch with {\\\\\\\\}
so if i am supposed to use regsub why u use regexp ?? i mean what is it doing then ? i tought u where replacing charsif {[regexp -nocase {<a href="(.*?)">(.*?)</a>} $line <---- data2 a b]} {
Code: Select all
if {[regexp -nocase {<a href="(.*?)">(.*?)</a>} $line <---- data2 a b]} {
Code: Select all
string match "<a href=\"*\">*</a>" $line
Code: Select all
if {[regexp -nocase {<a href="(.*?)">(.*?)</a>} $line <---- data2 a b]}
Code: Select all
if {[regexp -nocase {<a href="*<NOBR>*">"*</NOBR>*"</a>} $line <---- data2 a b]}
Code: Select all
set data2 [http::data $data]
http::cleanup $data
foreach line [split $data2 \n] {
if {[regexp {<NOBR>(.*?)</NOBR>} $line data2 a ]} {
puthelp "NOTICE $chan :$a"
}