Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3938319
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
#
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
}
proc
dcc:identica
{
handle
idx arg
}
{
}
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
Thu, Dec 26, 01:13 (4 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314161
Default Alt Text
Communication.tcl (1 KB)
Attached To
Mode
rVIPERSERV ViperServ scripts [legacy Mercurial repo]
Attached
Detach File
Event Timeline
Log In to Comment