Chappie Posted February 12, 2005 at 07:26 PM Report Posted February 12, 2005 at 07:26 PM Google has a translation section? I know altavista has one... babelfish... Its still slow.. I think its the website. Its " too" heavy for my connection. sending queries aint that hard I hacked a SMS service once . But the securcity was really crap
browny Posted February 13, 2005 at 03:43 AM Report Posted February 13, 2005 at 03:43 AM hehe cool man~! I know sending queries aren't that hard..hehe~ As for the speed problem, if you know a good (free) web host in europe, tell me, and i'll put the website up there too.
Chappie Posted February 14, 2005 at 01:04 AM Report Posted February 14, 2005 at 01:04 AM there are many places to set up one... butta could you give me the code for that? Im too lazy to create my "own" translation program
browny Posted February 14, 2005 at 03:36 AM Report Posted February 14, 2005 at 03:36 AM you want the php code to interface the google translator? OK, here is the code that you will need: /** * Get a remote file using POST * * $url String The url which locates the server, port number, and file. * $_query String The dat to be sent with the header * returns String the body of the file if successfull */ function fetchURL( $url, $_query ) { $url_parsed = parse_url($url); $host = $url_parsed["host"]; $port = $url_parsed["port"]; if ($port==0) $port = 80; $path = $url_parsed["path"]; $out = "POST $path HTTP/1.0rn"; $out .= "Host: $hostrn"; $out .= "Content-length: " . strlen($_query) . "rnrn"; $out .= $_query . "rn"; $fp = fsockopen($host, $port, $errno, $errstr, 30); fwrite($fp, $out); $body = false; while (!feof($fp)) { $s = fgets($fp, 1024); if ( $body ) $in .= $s; if ( $s == "rn" ) $body = true; } fclose($fp); return $in; } /** * Tranlate English to Chinese (GB2312) * Uses http://translate.google.com/translate_t * * $text String The English to be translated * returns String Chinese (GB2312) translated from $text */ function translateEnglishToChinese( $text ) { $data = fetchURL("http://translate.google.com/translate_t", "text=$text&langpair=en%7Czh-CN"); list($junk, $data) = split('<textarea name=q rows=5 cols=45 wrap=PHYSICAL>', $data); list($translation, $junk) = split('</textarea>', $data); return $translation; } /** * Tranlate Chinese (GB2312) to English * Uses http://translate.google.com/translate_t * * $text String The Chinese (GB2312) to be translated * returns String English translated from $text */ function translateChineseToEnglish( $text ) { $data = fetchURL("http://translate.google.com/translate_t", "text=$text&langpair=zh-CN%7Cen"); list($junk, $data) = split('<textarea name=q rows=5 cols=45 wrap=PHYSICAL>', $data); list($translation, $junk) = split('</textarea>', $data); return $translation; }
Chappie Posted February 16, 2005 at 08:50 PM Report Posted February 16, 2005 at 08:50 PM I cant read php... though... I can read Java But it doesnt output a textfield in php
Nings Posted February 23, 2005 at 09:07 AM Report Posted February 23, 2005 at 09:07 AM who want a QQ number? You can login the follow FREE number in 24 hours: 442021207----qCKXzUqDatyTalN 346429594----ZHfOzxsYcTANfVG 412236646----4LOCYsrWYFqEZB3 379861807----3eUucoVyCWNUMhA 287687318----znEDAVdDXc4MkPL Remember change the password to your own . Extra questions please contact me . nings@hotmail.it
twilighthush Posted March 3, 2005 at 07:27 AM Report Posted March 3, 2005 at 07:27 AM Does anyone have a problem with sending messages through QQ? Tonight, when I tried to send messages, I kept getting something like this: Last sent message: ": " failed to send(server timeout). I'm in the United States. Any clue what's going on?
Jim Posted March 3, 2005 at 07:51 AM Report Posted March 3, 2005 at 07:51 AM Maybe this news is related? Edit: sodding bbcode
twilighthush Posted March 3, 2005 at 08:23 AM Report Posted March 3, 2005 at 08:23 AM T_T; Jesus. Thank GOD I live in America.
Recommended Posts