Discussion Using the Translator API with Python

  • Monday, May 07, 2012 4:45 PM
     
     

    In case anyone's interested, I've written some code in Python to get an access token and make translations requests via the HTTP Interface.

    The background (which also includes a summary of all the accounts and services that you have to register for) is here and the actual code is here.


All Replies

  • Tuesday, May 08, 2012 8:11 PM
    Moderator
     
     
    That's awesome! +1 :)

    //Laurence Moroney: www.netnavi.tv // Author of 'Introducing Silverlight' series and much more // @lmoroney

  • Wednesday, May 09, 2012 7:14 PM
     
     

    Thanks, I hope people find it useful as a reference.

    I've also just written another snippet which uses lxml to get the text out of the xml object returned by the API (even though the current xml object is not very complex).

  • Friday, May 25, 2012 10:16 PM
     
     

    It turns out that hastebin, nifty as it is, doesn't store data very long, so I created two gists for the same code snippets:

    https://gist.github.com/2790853 is the actual code example

    https://gist.github.com/2790864 is the xml parsing snippet using lxml


  • Wednesday, June 06, 2012 5:32 AM
    Moderator
     
     
    Great stuff! :)