Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F32058110
Communication.tcl
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
Communication.tcl
View Options
package
require http
bind
dcc
-
sms dcc:sms
bind
pub
-
!
identica pub:identica
bind
pub
-
!
pub pub:identica
bind
pub
-
!
twit pub:identica
#
# SMS
#
#.sms
proc
dcc:sms
{
handle
idx arg
}
{
if
{
$arg
==
""
||
$arg
==
"config"
}
{
#Prints config
return
1
}
elseif
{[
string
range
$arg
0
6
]
==
"config "
}
{
putcmdlog
"#$handle# sms config ..."
return
0
}
else
{
#Sends a SMS
set
to
[
lindex
$arg
0
]
putcmdlog
"#$handle# sms ..."
}
return
0
}
#
# Identi.ca
#
#Posts $message on the identi.ca $account account
proc
identicapost
{
account
message
}
{
set
row
[
lindex
[
sql
"SELECT account_username, account_password FROM identica_accounts WHERE account_code = '$account'"
]
0
]
set
auth
"Basic [base64::encode [join $row :]]"
set
tok
[
::
http
::
geturl http:
//
identi.ca
/
api
/
statuses
/
update.xml
-
headers
[
list
Authorization
$auth
]
-
query
[
::
http
::
formatQuery status
$message
]]
::
http
::
cleanup
$tok
}
#.identica
proc
dcc:identica
{
handle
idx arg
}
{
}
#!pub !identica or !twit
proc
pub:identica
{
nick
uhost handle chan text
}
{
if
{
$chan
==
"#wikipedia-fr"
}
{
set
account wikipediafr
}
elseif
{
$chan
==
"#wolfplex"
}
{
set
account wolfplex
}
{
putquick
"NOTICE $nick :!pub n'est pas activésur $chan"
return
}
if
{
$text
==
""
}
{
putquick
"NOTICE $nick :Syntaxe : !pub <texte à publier sur identi.ca et Twitter>"
return
}
set
len
[
string
length
$text
]
if
{
$len
>
140
}
{
putquick
"NOTICE $nick :140 caractères max, là il y en a $len."
return
}
identicapost
$account
$text
putquick
"NOTICE $nick :Publié sur identi.ca"
return
1
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 8, 07:53 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3782212
Default Alt Text
Communication.tcl (1 KB)
Attached To
Mode
rVIPER ViperServ scripts
Attached
Detach File
Event Timeline
Log In to Comment