Let's say I've got a text file where it's added new rows - maybe 20 each day. How can I then count the rows for http://mydomain.com/list.txt and msg it like this msg $chan "$lines -1" (the last line at list.txt shouldn't count) - when someone writes !lines?
Also, I would like to make a function where the trigger is !check. If someone writes f.ex. "!check coffee", the script should get the response from http://mydomain.com/check.php?value=coffee and then msg $chan $result.
It would be awsome if some could help me out.
Last edited by JKM on Mon Dec 15, 2008 6:12 pm, edited 1 time in total.
Also, I would like to make a function where the trigger is !check. If someone writes f.ex. "!check coffee", the script should get the response from http://mydomain.com/check.php?value=coffee and then msg $chan $result.
yeah, but what will be the output of this query? smth like:
xxxxxxxxxxxxxxxxxxxxx - one line output
or smth:
xxxxxxxxxx
xxxxxxx
xxxxxxxxxxxx - many lines as output
Like this:
list.txt --->
1. roooow1
2. row2
3. rooow3
4. this is the last row!
So if you writes !list, it should msg "3" (4-1).
tomekk wrote:
Also, I would like to make a function where the trigger is !check. If someone writes f.ex. "!check coffee", the script should get the response from http://mydomain.com/check.php?value=coffee and then msg $chan $result.
yeah, but what will be the output of this query? smth like:
xxxxxxxxxxxxxxxxxxxxx - one line output
or smth:
xxxxxxxxxx
xxxxxxx
xxxxxxxxxxxx - many lines as output
?
On output could be like "xxxxxxx" and one could be "xxxxxxxxxxxxxx" - everything is at one row.
Thanks a lot! I can't - unfortunately - test it before friday (when I'm ordering my shell).
By the way, could you please make another thing for me?
!search xx -> paste the result from mypage.com?search.php?f=xx. IF the page shows more than three rows (ex. 20 lines), it should past it like this:
row1
row2
row3
... And further 17 (20-3) lines: mypage.com?search.php?f=xx
JKM wrote:Thanks a lot! I can't - unfortunately - test it before friday (when I'm ordering my shell).
By the way, could you please make another thing for me?
!search xx -> paste the result from mypage.com?search.php?f=xx. IF the page shows more than three rows (ex. 20 lines), it should past it like this:
row1
row2
row3
... And further 17 (20-3) lines: mypage.com?search.php?f=xx
after 3 lines script should write link to this or this script should print all 20 lines?
This script should only print the first three lines at the page (if there is more than three lines). At the end it should echo "... And further XX (Total lines - 3) lines - http://url".
JKM wrote:This script should only print the first three lines at the page (if there is more than three lines). At the end it should echo "... And further XX (Total lines - 3) lines - http://url".
proc check_proc { nick uhost hand chan arg } {
global check_url check_url_arg check_chans
if {[lsearch $check_chans $chan] != -1} {
set check_arg [lindex [split $arg] 0]
if {$check_arg != ""} {
set one_data_line [grab_http_data 2 $check_url $check_url_arg $check_arg]
if {$one_data_line != "error"} {
putquick "PRIVMSG $chan :$one_data_line"
}
}
}
}
Again, thanks a lot! But I've got some questions.
1: I wan't to reply "Nothing found" if the line is " N/A N/A N/A N/A N/A N/A N/A 1 " - so would this work?
Hi there! The scripts is working great, but I was wondering if you could extend the !search script. I wan't to get xml data (<field1></field1> and <field2></field2> but not the rest - including such as "<?xml version='1.0' encoding='us-ascii' ?>" and so on.).
JKM wrote:Hi there! The scripts is working great, but I was wondering if you could extend the !search script. I wan't to get xml data (<field1></field1> and <field2></field2> but not the rest - including such as "<?xml version='1.0' encoding='us-ascii' ?>" and so on.).
Thanks for the help this far!
hey,
Paste here full example of this XML structure, I need to see it
Insert some fake data etc.