वेब पर कब्जा और परिवर्तित करने के लिए उपकरण

पर्पल के साथ GrabzIt हैंडलर

पर्ल एपीआई

Description

अपने हैंडलर को डिबग करने में समस्याएँ हो रही हैं? की कोशिश कॉलबैक हैंडलर टेस्ट टूल।

हैंडलर ने यहां बताया कि GrabzIt स्क्रीनशॉट वेब सेवा से कॉलबैक की प्रक्रिया करता है। इस हैंडलर का URL GrabzIt में पास किया गया है callBackURL का पैरामीटर Save विधि. हालाँकि यह तकनीक तभी काम करेगी जब हैंडलर के माध्यम से पहुँचा जा सके Internet।

निम्नलिखित मापदंडों को जीईटी मापदंडों के रूप में हैंडलर को पारित किया जाता है।

अगर आप GrabzIt को छोड़कर हैंडलर के सभी एक्सेस को ब्लॉक करना चाहते हैं, तो इसका उपयोग करें सुरक्षा तकनीक.

उदाहरण

याद रखें यदि आपका एप्लिकेशन लोकलहोस्ट पर स्थित है तो यह कॉलबैक काम नहीं करेगा।

यह उदाहरण दिखाता है कि GrabzIt पर्ल हैंडलर को कैसे कार्यान्वित किया जा सकता है। यह GrabzIt सेवा से पास किए गए छह मापदंडों को कैप्चर करता है, जिसमें स्क्रीनशॉट की अद्वितीय आईडी भी शामिल है जो इसे पास किया गया है GetResult विधि.

यह विधि तब स्क्रीनशॉट लौटाती है, जो है saved परिणाम निर्देशिका में। हालाँकि यदि ए null मान से लौटा है GetResult विधि यह इंगित करती है कि एक त्रुटि हुई है।

use CGI;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser); 
use File::Spec;
use GrabzIt::GrabzItClient;

# This Perl file handles the GrabzIt callback

print "HTTP/1.0 200 OK";
print "Content-type: text/html\r\n\r\n";

$cgi = new CGI;

$message = $cgi->param("message");
$customId = $cgi->param("customid");
$id = $cgi->param("id");
$filename = $cgi->param("filename");
$format = $cgi->param("format");
$targetError = $cgi->param("targeterror");

# Custom id can be used to store user ids or whatever is needed for the later processing of the
# resulting screenshot

$grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")%>");
$result = $grabzIt->GetResult($id);

if ($result)
{
        # Ensure that the application has the correct rights for this directory.
        open FILE, ">".File::Spec->catfile("results",$filename) or die $!; 
        binmode FILE;
        print FILE $result; 
        close FILE;
}