-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcscEN.tcl
115 lines (96 loc) · 3.71 KB
/
cscEN.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#################################################################
#
# Csc EN TCL 1.1
#
# Check the status of an existing channel aplication
# through CService on UnderNet.
# Originaly wroted by BaRDaHL
#
# .chanset #chan +csc | .set +csc
#
# Syntax: .csc <chan>
#
# BLaCkShaDoW ProductionS
# _ _ _ _ _ _ _ _ _ _ _ _ _ _
# / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
# ( t | c | l | s | c | r | i | p | t | s | . | n | e | t )
# \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
# #TCL-HELP @ Undernet.org
#
#################################################################
package require http
bind pub -|- .csc checkcsc
setudef flag csc
proc checkcsc {nick host hand chan arg} {
set valchan [lindex [split $arg] 0]
if {![channel get $chan csc]} {
return
}
if { $valchan == "#" } {
puthelp "NOTICE $nick :\[CService\] - Please use proper format: .csc <channelname>"
return
}
if { $valchan == "" } {
puthelp "NOTICE $nick :\[CService\] - Please use proper format: .csc <channelname>"
return
}
set dachan [wt:filter $valchan]
if {[regexp {^[\\+!#&]} $valchan]} {
set valchan [string trim $valchan "#"]
}
set token [http::config -useragent "lynx"]
set ipq [http::geturl "http://cscreg.000webhostapp.com/index.php?channel=https://cservice.undernet.org/live/check_app.php?name=$valchan" -timeout 15000]
set getipq [http::data $ipq]
set output [split $getipq "\n"]
http::cleanup $ipq
if {$getipq == ""} {
puthelp "NOTICE $nick :$valchan: No applications matched that channel."
return
}
set byuser [lindex $output 0]
set byuser [concat [string map {" " "" } $byuser]]
set date [lindex $output 1]
set date [concat [string map {" " ""} $date]]
set status [lindex $output 2]
set status [concat [string map {" " ""} $status]]
set objections [lindex $output 3]
set decision [lindex $output 4]
set decision [concat [string map {" " ""} $decision]]
set desc [lindex $output 5]
set desc [concat [string map {" " ""} $desc]]
set link [lindex $output 6]
if {[string equal -nocase $status "pending"]} {
set status "$status"
} elseif {[string equal -nocase $status "incoming"]} {
set status "$status"
} elseif {[string equal -nocase $status "rejected"]} {
set status "$status"
} elseif {[string equal -nocase $status "accepted"]} {
set status "$status"
} elseif {[string equal -nocase $status "ready for review"]} {
set status "$status"
} elseif {[string equal -nocase $status "cancelled by the applicant"]} {
set status "$status"
}
if {$decision == "NONE"} { set decision "n/a" }
putserv "NOTICE $nick :\[CService\] - Channel: \#$valchan\ | Status: $status | Applicant: $byuser | Date: $date | Objections: $objections | Comments: $decision | URL: $link"
putserv "NOTICE $nick :\[CService\] - Description: $desc"
}
proc wt:filter {x {y ""} } {
for {set i 0} {$i < [string length $x]} {incr i} {
switch -- [string index $x $i] {
"é" {append y "%E9"}
"è" {append y "%E8"}
"î" {append y "%CE"}
"É" {append y "%E9"}
"È" {append y "%E8"}
"Î" {append y "%CE"}
"&" {append y "%26"}
" " {append y "+"}
default {append y [string index $x $i]}
}
}
return $y
}
#################################################################################
putlog "Csc EN TCL 1.1 by BLaCkShaDoW Loaded (Originaly wroted by BaRDaHL)"