putquick"NOTICE $nick :!identica is currently disabled. Is identi.ca still usable since pump.io migration? If so, please request the command."
}
procwhois{nickname}{
# By handle
setresult[nick2hand$nickname]
if{$result!="*"}{
#Will return "", when nick doesn't exist to avoid further processing.
return$result
}
#Gets user@host
setuhost[getchanhost$nickname]
sethost[lindex[split$uhost@]1]
# By Cloak
if{[regexp/$host]}{
setcloak[split$host/]
setgroup[lindex$cloak0]
if{$group!="gateway"&&$group!="nat"}{
# @freenode/staff/ubuntu.member.niko → niko
# @wikipedia/pdpc.21for7.elfix → elfix
# @wikipedia/poulpy → poulpy
return[lindex[split[lindex$cloakend].]end]
}
}
# By NickServ
# TODO: code with callback
# By user@host, when the host doesn't contain any digit
if{[regexp{^[^0-9]*$}$host]}{
return"$nickname!$uhost"
}
# Can't identify
return""
}
#!pub or !twit or !tweet
#The account is channel dependant
procpub:twitter{nickuhosthandlechantext}{
if{$chan=="#wikipedia-fr"}{
setaccountwikipediafr
setwho[whois$nick]
if{$who==""}{
putquick"NOTICE $nick :Pour utiliser !pub sur $chan, vous devez disposer d'un cloak projet ou unaffiliated, être connecté depuis un host sans chiffre ou encore avoir votre user@host reconnu par mes soins."
return0
}{
appendtext" —$who"
}
}elseif{$chan=="#wolfplex"}{
setaccountwolfplex
}{
putquick"NOTICE $nick :!pub n'est pas activé sur le canal $chan"
return
}
twitterpublish$account$nick$text
}
proctwitterpublish{accountnicktext}{
if{$text==""}{
putquick"NOTICE $nick :Syntaxe : !pub <texte à publier sur identi.ca et Twitter>"
return
}
setlen[stringlength$text]
if{$len>140}{
putquick"NOTICE $nick :140 caractères max, là il y en a $len."
return
}
if[twitterpost$account$text]{
putquick"NOTICE $nick :Publié sur Twitter"
return1
}{
putquick"NOTICE $nick :Non publié, une erreur a eu lieu."