Changes between Version 4 and Version 5 of XmlRpcIntro


Ignore:
Timestamp:
Sep 28, 2008, 12:57:13 PM (16 years ago)
Author:
guest
Comment:

added sections on 'Languages' and 'File handling'

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcIntro

    v4 v5  
    11= Introduction to OSDb =
    22
    3 [[PageOutline(2, Sections)]]
     3[[PageOutline(1-2, Sections)]]
    44
    55This page is aimed at developers who'd like to implement the OSDb protocol and functionality into their own applications.
     
    2121
    2222= Instructions =
     23
    2324 * [wiki:DevReadFirst Read this first]
    2425 * All development testing should be pointed to: http://dev.opensubtitles.org/xml-rpc (currently offline, so use main server)
    2526 * Main/Production server XML-RPC URL: http://www.opensubtitles.org/xml-rpc
    2627 * Before developing let us know and we will assign/agree on useragent code for your application.
    27  * For languages codes, check [http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes ISO639], use '''pb/pob''' for Portuguese (Brazil) - [http://www.opensubtitles.org/addons/export_languages.php Download OS languages table dump]
    28  * For gzip compression use function which adds no header to output, for PHP it's: [http://www.php.net/manual/en/function.gzcompress.php gzcompress]. For decompression use [http://www.php.net/gzuncompress gzdecompress].
     28
     29== Languages ==
     30
     31  The API is working with either 2 (ISO 639-1) or 3-letter (ISO 639-2) language codes depending on the implementation.
     32 
     33  To learn more, see the specifications and get language lists, visit:
     34    * [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes List of ISO 639-1 2-letter codes on Wikipedia]
     35    * [http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes List of ISO 639-2 3-letter codes on Wikipedia]
     36 
     37  You can also download [http://www.opensubtitles.org/addons/export_languages.php OS languages] table dump.
     38
     39  You should use '''pb/pob''' for Portuguese (Brazil).
    2940
    3041
     42== File handling ==
     43
     44  When sending files (download, upload, etc.) files are usually sent as first gzipped (without header) then base64-encoded contents.
     45 
     46  So when trying to get the contents you should first base64-decode, then gunzip it.
     47     
     48  gzip compression uses a function which adds no header to output.
     49
     50  Here's a list of functions you can use:
     51 
     52  ||Programming language||Compress||Decompress||Base64 encode||Base64 decode||
     53  ||PHP||[http://www.php.net/manual/en/function.gzcompress.php gzcompress]||[http://www.php.net/gzuncompress gzdecompress]||?||?||
     54
     55{{{
     56#!html
     57  <div style='color:red'>TO-DO</div>
     58}}}
     59
     60
     61----
    3162= XML-RPC methods =
    3263
     
    6495== Reporting and rating ==
    6596  * [wiki:XmlRpcServerInfo ServerInfo] - get basic server information and statistics
     97      '''struct !ServerInfo()'''
    6698  * [wiki:XmlRpcReportMovieHash ReportMovieHash] - report wrong
    6799  * [wiki:XmlRpcSubtitlesVote SubtitlesVote] - rate subtitles
     100      '''struct !SubtitlesVote(string $token, struct('idsubtitle' => int $idsubtitle, 'score' => int $score) $vote)''' 
    68101
    69102
    70103== User interface ==
    71   * [wiki:XmlRpcGetSubLanguages GetSubLanguages] - get support subtitle languages
     104  * [wiki:XmlRpcGetSubLanguages GetSubLanguages] - get supported subtitle languages
     105      '''struct !GetSubLanguages(string $language = 'en')'''
    72106  * [wiki:XmlRpcDetectLanguage DetectLanguage] - detect language for given text
    73107  * [wiki:XmlRpcGetAvailableTranslations GetAvailableTranslations] - get list of available translations for a client application
     108      '''struct !GetAvailableTranslations(string $token, string $program)'''
    74109  * [wiki:XmlRpcGetTranslation GetTranslation] - get given language translation file for a client application
     110      '''struct !GetTranslation(string $token, string $iso639, string $format, string $program )'''
    75111  * [wiki:XmlRpcAutoUpdate AutoUpdate] - check for latest version of a client application
     112      '''struct !AutoUpdate (string $program_name)'''
    76113
    77114