0

スクリプトで solvemedia キャプチャを挿入する方法を知りたいです。私は彼らのサイト (https://portal.solvemedia.com/media/download/WWW-SolveMedia-1.1.tar.gz) からモジュールをインストールしましたが、これを追加する場所がわかりません (彼らの指示):

プラグインがインストールされると、Solve Media API の呼び出しを開始できます。 ウィジェットを表示する

To display the Solve Media widget on one of your forms, instantiate the SolveMedia class, supplying it with your API keys. Then call the get_html function. You can find your API keys at My account:

use WWW::SolveMedia;
my $c = WWW::SolveMedia->new( 'my challenge key',
            'my verification key',
            'my hash key' );

# output widget
print $c->get_html();

Process Answer

You can check the user's response by calling SolveMedia.check_answer(...).

# check answer
my $result = $c->check_answer( $ENV{REMOTE_ADDR}, $challenge, $response );

if( $result->{is_valid} ){
    print "Yay!";
}else{
    print "Dang it :-(\n";
    print "Error: ".$result->{error};
}

And this is where I get stuck, cos I don't have a clue how/where to insert that code. If anyone of you is willing to help, please respond. I'm willing to pay a few bucks.

4

1 に答える 1

1

新しいオブジェクトを作成し、get_htmlの結果を変数に保存してから、Webページに貼り付けるか、インラインで印刷します。

キャプチャを表示するページを生成するサブルーチンにPerlコードを配置します。そして、キャプチャを印刷したページのフォームの送信を処理するコードに、processの呼び出しを配置し​​ます。

于 2012-11-02T23:03:09.483 に答える