###################################
##Title: Remote Google Translate
##Author: HambaMalam
##Server: /server irc.kampungchat.org:6667
##Channel: #hackers
##Credit: RileksCrew+H3x4crew+Newbie3vilc063s
###################################
google translate:
info= %7C = |
http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=hello%20world&langpair=en%7Cit
alias tgo {
set %tgo.input $replace($1- , $chr(32) , $chr(37) $+ 20 )
if ($sock(tgo)) .sockclose tgo
sockopen tgo ajax.googleapis.com 80
}
on *:sockopen:tgo:{
sockwrite -nt $sockname GET /ajax/services/language/translate?v=1.0&q= $+ %tgo.input $+ &langpair=ms%7C $+ %tgo.lang HTTP/1.1
sockwrite -nt $sockname Host: ajax.googleapis.com
sockwrite -nt $sockname $crlf
}
on *:sockread:tgo:{
sockread -f %tgo | tgoget %tgo
}
alias tgoget {
if $1 != {"responseData": goto end
msg $active $replace($1- , "responseDetails": null , $chr(32) , "responseStatus": 200} , $chr(32) , {"responseData": {"translatedText":" , $chr(32), "} , $chr(32) , $chr(44) , $chr(32) )
:end
}
alias tgo1 {
set %tgo.input1 $replace($1- , $chr(32) , $chr(37) $+ 20 )
if ($sock(tgo1)) .sockclose tgo1
sockopen tgo1 ajax.googleapis.com 80
}
on *:sockopen:tgo1:{
sockwrite -nt $sockname GET /ajax/services/language/translate?v=1.0&q= $+ %tgo.input1 $+ &langpair= $+ %tgo.lang $+ $chr(37) $+ 7Cms HTTP/1.1
sockwrite -nt $sockname Host: ajax.googleapis.com
sockwrite -nt $sockname $crlf
}
on *:sockread:tgo1:{
sockread -f %tgo1 | tgoget1 %tgo1
}
alias tgoget1 {
if $1 != {"responseData": goto end
echo %translate Data: $replace($1- , "responseDetails": null , $chr(32) , "responseStatus": 200} , $chr(32) , {"responseData": {"translatedText":" , $chr(32), "} , $chr(32) , $chr(44) , $chr(32) )
:end
}
on *:input:*:{
if %translate != $active goto end
if $left($1,1) == / goto end
tgo $1- | halt
:end
}
on *:text:*:#:{
if $chan != %translate goto end
tgo1 $1-
:end
}
on *:text:*:?:{
if $nick != %translate goto end
tgo1 $1-
:end
}
menu channel {
-
Translator
.Enable: set %translate $chan
.Disable: set %translate off
.LANGGUAGE
.. english: set %tgo.lang en
..afrikaans: set %tgo.lang af
..albanian: set %tgo.lang sq
..arabic: set %tgo.lang ar
..croatian: set %tgo.lang hr
..filipino: set %tgo.lang tl
..french: set %tgo.lang fr
..german: set %tgo.lang de
..greek: set %tgo.lang el
..hebrew: set %tgo.lang iw
..italian: set %tgo.lang it
..japan: set %tgo.lang ja
..korean: set %tgo.lang ko
..polish: set %tgo.lang pl
..russian: set %tgo.lang ru
..serbian: set %tgo.lang sr
..spanish: set %tgo.lang es
..thai: set %tgo.lang th
..chinese: set %tgo.lang zh-CN
..dutch: set %tgo.lang nl
..swedish: set %tgo.lang sv
..bulgaria: set %tgo.lang bg
..czech: set %tgo.lang cs
..estonia: set %tgo.lang et
..Hungarian: set %tgo.lang hu
..Iceland: set %tgo.lang is
..Irish: set %tgo.lang ga
..Latvian: set %tgo.lang lv
..Macedonia: set %tgo.lang mk
..Norway: set %tgo.lang no
..Parsi: set %tgo.lang fa
..romania: set %tgo.lang ro
..turki: set %tgo.lang tr
..ukrain: set %tgo.lang uk
..urdu: set %tgo.lang ur
..vietnam: set %tgo.lang vi
..yiddish: set %tgo.lang yi
..slovenia: set %tgo.lang sl
..slovak: set %tgo.lang sk
..portugis: set %tgo.lang pt
..maltese: set %tgo.lang mt
..haiti: set %tgo.lang ht
..finnish: set %tgo.lang fi
..hindi: set %tgo.lang hi
..lithuanian: set %tgo.lang lt
}
menu query {
-
Translator
.Enable: set %translate $$1
.Disable: set %translate off
.LANGGUAGE
.. english: set %tgo.lang en
..afrikaans: set %tgo.lang af
..albanian: set %tgo.lang sq
..arabic: set %tgo.lang ar
..croatian: set %tgo.lang hr
..filipino: set %tgo.lang tl
..french: set %tgo.lang fr
..german: set %tgo.lang de
..greek: set %tgo.lang el
..hebrew: set %tgo.lang iw
..italian: set %tgo.lang it
..japan: set %tgo.lang ja
..korean: set %tgo.lang ko
..polish: set %tgo.lang pl
..russian: set %tgo.lang ru
..serbian: set %tgo.lang sr
..spanish: set %tgo.lang es
..thai: set %tgo.lang th
..chinese: set %tgo.lang zh-CN
..dutch: set %tgo.lang nl
..swedish: set %tgo.lang sv
..bulgaria: set %tgo.lang bg
..czech: set %tgo.lang cs
..estonia: set %tgo.lang et
..Hungarian: set %tgo.lang hu
..Iceland: set %tgo.lang is
..Irish: set %tgo.lang ga
..Latvian: set %tgo.lang lv
..Macedonia: set %tgo.lang mk
..Norway: set %tgo.lang no
..Parsi: set %tgo.lang fa
..romania: set %tgo.lang ro
..turki: set %tgo.lang tr
..ukrain: set %tgo.lang uk
..urdu: set %tgo.lang ur
..vietnam: set %tgo.lang vi
..yiddish: set %tgo.lang yi
..slovenia: set %tgo.lang sl
..slovak: set %tgo.lang sk
..portugis: set %tgo.lang pt
..maltese: set %tgo.lang mt
..haiti: set %tgo.lang ht
..finnish: set %tgo.lang fi
..hindi: set %tgo.lang hi
..lithuanian: set %tgo.lang lt
}