有人使用浏览器截图的 API 吗?

发布于 2024-09-24 04:24:55 字数 874 浏览 7 评论 0原文

我无法让 API xmlrpc 与浏览器截图一起使用,这真的很烦人。 第一种方法 $method = 'nonces.challenge'; http://api.browsershots.org/xmlrpc/nonces.challenge/

如何我是否得到了主机名,这意味着它似乎对我不利。

nonces.verifyUser 说它需要 2 个输入,而我正在使用它

$params = array();
$params[username] = 'username';
$params[encrypted_password] = 'password';


$request = xmlrpc_encode_request  ($method  ,  $params);
echo "<pre>";
print_r($request);
echo "</pre>";

$context = stream_context_create(array('http' => array(
    'method' => "POST",
    'header' => "Content-Type: text/xml",
    'content' => $request
)));

echo "<pre>";
print_r($context);
echo "</pre>";

$file = file_get_contents($browser_shots_url, false, $context);

print_r($file);

,它说我缺少一个。我哪里出错了?

I can't get the API xmlrpc to work with browser shots its really annoying.
The first method
$method = 'nonces.challenge';
http://api.browsershots.org/xmlrpc/nonces.challenge/

How do I get the hostname that it meantions it seems just against me.

The nonces.verifyUser says it needs 2 inputs and I'm using

$params = array();
$params[username] = 'username';
$params[encrypted_password] = 'password';


$request = xmlrpc_encode_request  ($method  ,  $params);
echo "<pre>";
print_r($request);
echo "</pre>";

$context = stream_context_create(array('http' => array(
    'method' => "POST",
    'header' => "Content-Type: text/xml",
    'content' => $request
)));

echo "<pre>";
print_r($context);
echo "</pre>";

$file = file_get_contents($browser_shots_url, false, $context);

print_r($file);

And it says I'm missing one. Where am I going wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最终幸福 2024-10-01 04:24:55

我希望你能理解我的 perl:

#!/usr/bin/perl
# Documentation at: http://api.browsershots.org/xmlrpc/
# Or through the system.listMethods and system.methodHelp <method> calls
use strict;
use warnings;
use RPC::XML;
use RPC::XML::Client;
use Data::Dumper;
use Digest::MD5 qw(md5_hex);
use Digest::SHA1 qw(sha1_hex);

my $cli = RPC::XML::Client->new('http://api.browsershots.org/xmlrpc/');

my $resp = $cli->send_request('nonces.challengeUser','USERNAME');
my $pw_hash;
if ($resp->{algorithm}->value eq "sha1") {
    $pw_hash = sha1_hex($resp->{salt}->value."PASSWORD");
} else {
    warn "md5 algorithm";
}
my $verify_string = md5_hex($pw_hash.$resp->{nonce}->value);
print "$verify_string\n";
my $login = $cli->send_request('nonces.verifyUser','USERNAME',$verify_string);
my $browsers = $cli->send_request('browsers.active');
$resp = $cli->send_request('nonces.challengeUser','USERNAME');
$pw_hash = sha1_hex($resp->{salt}->value."PASSWORD");
$verify_string = md5_hex($pw_hash.$resp->{nonce}->value);
my $screq = $cli->send_request('requests.submit','xssmirror',$verify_string,'http://www.domain.com','');
print Dumper($screq);

你需要一个付费帐户才能以这种方式获取屏幕截图。

I hope you can grok my perl:

#!/usr/bin/perl
# Documentation at: http://api.browsershots.org/xmlrpc/
# Or through the system.listMethods and system.methodHelp <method> calls
use strict;
use warnings;
use RPC::XML;
use RPC::XML::Client;
use Data::Dumper;
use Digest::MD5 qw(md5_hex);
use Digest::SHA1 qw(sha1_hex);

my $cli = RPC::XML::Client->new('http://api.browsershots.org/xmlrpc/');

my $resp = $cli->send_request('nonces.challengeUser','USERNAME');
my $pw_hash;
if ($resp->{algorithm}->value eq "sha1") {
    $pw_hash = sha1_hex($resp->{salt}->value."PASSWORD");
} else {
    warn "md5 algorithm";
}
my $verify_string = md5_hex($pw_hash.$resp->{nonce}->value);
print "$verify_string\n";
my $login = $cli->send_request('nonces.verifyUser','USERNAME',$verify_string);
my $browsers = $cli->send_request('browsers.active');
$resp = $cli->send_request('nonces.challengeUser','USERNAME');
$pw_hash = sha1_hex($resp->{salt}->value."PASSWORD");
$verify_string = md5_hex($pw_hash.$resp->{nonce}->value);
my $screq = $cli->send_request('requests.submit','xssmirror',$verify_string,'http://www.domain.com','');
print Dumper($screq);

You'll need a paid account to obtain screenshots this way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文