LoginSignup
2
1

More than 5 years have passed since last update.

textra apiを使って英日翻訳

Posted at

作業手順

  1. PHPを動かすためにWebサーバを用意する。(MAMPなら便利)
  2. API一覧のURLをクリックすればパラメータとコードが見られる。ここでは英日翻訳APIを試すので、『みんなの : 英語 - 日本語』を使う。
  3. サンプルコードをhtdocs以下に配置する。
  4. 以下のパラメータに与えを入れる
    define("NAME", "");
    define("KEY", "");
    define("SECRET", "");
    define("URL", "");
  5. oauth-phpライブラリもhtdocs以下に設置し、ソースの中身を書き換える。 include("oauth-php/library/OAuthStore.php"); include("oauth-php/library/OAuthRequester.php");
  6. Default原文("Hello World!!")は翻訳されない場合があるようで、違う英語に置き換えましょう。
    "text" => "Hello World!!",
    "text" => "I live in Japan.",

    (終わり)
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1