GrabzItClient-3.5.7/000777 000000 000000 00000000000 14611554455 012413 5ustar00000000 000000 GrabzItClient-3.5.7/GrabzItAnimationOptions.pm000666 000000 000000 00000010502 14560247312 017517 0ustar00000000 000000 #!/usr/bin/perl package GrabzItAnimationOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"width"} = 0; $self->{"height"} = 0; $self->{"start"} = 0; $self->{"duration"} = 1; $self->{"speed"} = 0; $self->{"framesPerSecond"} = 0; $self->{"repeat"} = 0; $self->{"reverse"} = 0; $self->{"customWaterMarkId"} = ''; $self->{"quality"} = -1; bless $self, $class; return $self; } # # The width of the resulting animated GIF in pixels # sub width { my $self = shift; if (scalar(@_) == 1) { $self->{"width"} = shift; } return $self->{"width"}; } # # The height of the resulting animated GIF in pixels # sub height { my $self = shift; if (scalar(@_) == 1) { $self->{"height"} = shift; } return $self->{"height"}; } # # The starting position of the video that should be converted into an animated GIF # sub start { my $self = shift; if (scalar(@_) == 1) { $self->{"start"} = shift; } return $self->{"start"}; } # # The length in seconds of the video that should be converted into a animated GIF # sub duration { my $self = shift; if (scalar(@_) == 1) { $self->{"duration"} = shift; } return $self->{"duration"}; } # # The speed of the animated GIF from 0.2 to 10 times the original speed # sub speed { my $self = shift; if (scalar(@_) == 1) { $self->{"speed"} = shift; } return $self->{"speed"}; } # # The number of frames per second that should be captured from the video # sub framesPerSecond { my $self = shift; if (scalar(@_) == 1) { $self->{"framesPerSecond"} = shift; } return $self->{"framesPerSecond"}; } # # The number of times to loop the animated GIF. If 0 it will loop forever # sub repeat { my $self = shift; if (scalar(@_) == 1) { $self->{"repeat"} = shift; } return $self->{"repeat"}; } # # True if the frames of the animated GIF should be reversed # sub reverse { my $self = shift; if (scalar(@_) == 1) { $self->{"reverse"} = shift; } return $self->{"reverse"}; } # # The custom watermark to add to the animated GIF # sub customWaterMarkId { my $self = shift; if (scalar(@_) == 1) { $self->{"customWaterMarkId"} = shift; } return $self->{"customWaterMarkId"}; } # # The quality of the image where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality # sub quality { my $self = shift; if (scalar(@_) == 1) { $self->{"quality"} = shift; } return $self->{"quality"}; } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->height()."|".$self->width()."|".$self->customId()."|".$self->framesPerSecond()."|".$self->speed()."|".$self->duration()."|".$self->repeat(). "|".$self->reverse()."|".$self->start()."|".$self->customWaterMarkId()."|".$self->country()."|".$self->quality()."|".$self->exportURL()."|".$self->encryptionKey()."|".$self->proxy(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'width'} = $self->width(); $params->{'height'} = $self->height(); $params->{'duration'} = $self->duration(); $params->{'speed'} = $self->speed(); $params->{'start'} = $self->start(); $params->{'fps'} = $self->framesPerSecond(); $params->{'repeat'} = $self->repeat(); $params->{'customwatermarkid'} = $self->customWaterMarkId(); $params->{'reverse'} = $self->reverse(); $params->{'quality'} = $self->quality(); return $params; } 1;GrabzItClient-3.5.7/GrabzItBaseOptions.pm000666 000000 000000 00000004734 13766733233 016475 0ustar00000000 000000 #!/usr/bin/perl package GrabzItBaseOptions; use URI::Escape; sub new { my $class = shift; my $self = { }; $self->{"customId"} = ''; $self->{"country"} = ''; $self->{"exportURL"} = ''; $self->{"encryptionKey"} = ''; $self->{"delay"} = 0; $self->{"post"} = ''; $self->{"proxy"} = ''; bless $self, $class; return $self; } # # The custom identifier that you are passing through to the web service # sub customId { my $self = shift; if (scalar(@_) == 1) { $self->{"customId"} = shift; } return $self->{"customId"}; } # # The country the capture should be created from: Default = "", Singapore = "SG", UK = "UK", US = "US" # sub country { my $self = shift; if (scalar(@_) == 1) { $self->{"country"} = shift; } return $self->{"country"}; } # # The encryption key that will be used to encrypt your capture # sub encryptionKey { my $self = shift; if (scalar(@_) == 1) { $self->{"encryptionKey"} = shift; } return $self->{"encryptionKey"}; } # # The export URL that should be used to transfer the capture to a third party location # sub exportURL { my $self = shift; if (scalar(@_) == 1) { $self->{"exportURL"} = shift; } return $self->{"exportURL"}; } # # The HTTP proxy that should be used to create the capture # sub proxy { my $self = shift; if (scalar(@_) == 1) { $self->{"proxy"} = shift; } return $self->{"proxy"}; } sub _appendPostParameter($$$) { my ($self, $qs, $name, $value) = @_; my $val = ''; if ($name ne '') { $val = uri_escape($name); $val .= "="; if ($value ne '') { $val .= uri_escape($value); } } if ($val eq '') { return $qs; } if ($qs ne '') { $qs .= "&"; } $qs .= $val; return $qs; } sub createParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; my %params = {}; $params->{'key'} = $applicationKey; $params->{'country'} = $self->country(); $params->{'export'} = $self->exportURL(); $params->{'encryption'} = $self->encryptionKey(); $params->{'proxy'} = $self->proxy(); $params->{'customid'} = $self->customId(); $params->{'callback'} = $callBackURL; $params->{'sig'} = $sig; $params->{$dataName} = $dataValue; return $params; } 1;GrabzItClient-3.5.7/GrabzItClient.pm000666 000000 000000 00000052705 14562171144 015456 0ustar00000000 000000 #!/usr/bin/perl package GrabzItClient; use Digest::MD5 qw(md5_hex); use Encode; use LWP::Simple; use LWP::UserAgent; use HTTP::Request::Common qw(POST); use URI::Escape; use XML::Twig; use File::Spec; use File::Basename; use ScreenShotStatus; use GrabzItCookie; use GrabzItWaterMark; use GrabzItRequest; use GrabzItAnimationOptions; use GrabzItImageOptions; use GrabzItVideoOptions; use GrabzItTableOptions; use GrabzItPDFOptions; use GrabzItDOCXOptions; use GrabzItHTMLOptions; use constant WebServicesBaseURL => "://api.grabz.it/services/"; use constant TakePicture => "takepicture"; use constant TakeVideo => "takevideo"; use constant TakeTable => "taketable"; use constant TakePDF => "takepdf"; use constant TakeDOCX => "takedocx"; use constant TakeHTML => "takehtml"; use constant TrueString => "True"; sub new { my $class = shift; my $self = { _applicationKey => shift, _applicationSecret => shift, }; $self->{protocol} = "http"; bless $self, $class; return $self; } # # This method specifies the URL of the online video that should be converted into a animated GIF # # url - The URL to convert into a animated GIF # options - A instance of the GrabzItAnimationOptions class that defines any special options to use when creating the animated GIF # sub URLToAnimation($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItAnimationOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . "takeanimation", 0, $options, $url); } # # This method specifies the URL that should be converted into a image screenshot. # # url - The URL to capture as a screenshot. # options - A instance of the GrabzItImageOptions class that defines any special options to use when creating the screenshot # sub URLToImage($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItImageOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakePicture, 0, $options, $url); } # # This method specifies the HTML that should be converted into a image. # # html - The HTML to convert into a image. # options - A instance of the GrabzItImageOptions class that defines any special options to use when creating the image # sub HTMLToImage($;$) { my ($self, $html, $options) = @_; $options ||= GrabzItImageOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakePicture, 1, $options, $html); } # # This method specifies a HTML file that should be converted into a image. # # path - The file path of a HTML file to convert into a image. # options - A instance of the GrabzItImageOptions class that defines any special options to use when creating the image. # sub FileToImage($;$) { my ($self, $path, $options) = @_; $self->HTMLToImage($self->_readHTMLFile($path), $options); } # # This method specifies the URL that should be converted into a video. # # url - The URL to convert into a video. # options - A instance of the GrabzItVideoOptions class that defines any special options to use when creating the video # sub URLToVideo($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItVideoOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeVideo, 0, $options, $url); } # # This method specifies the HTML that should be converted into video. # # html - The HTML to convert into a video. # options - A instance of the GrabzItVideoOptions class that defines any special options to use when creating the video # sub HTMLToVideo($;$) { my ($self, $html, $options) = @_; $options ||= GrabzItVideoOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeVideo, 1, $options, $html); } # # This method specifies a HTML file that should be converted into a video. # # path - The file path of a HTML file to convert into a video. # options - A instance of the GrabzItVideoOptions class that defines any special options to use when creating the video. # sub FileToImage($;$) { my ($self, $path, $options) = @_; $self->HTMLToVideo($self->_readHTMLFile($path), $options); } # # This method specifies the URL that should be converted into rendered HTML. # # url - The URL to capture as rendered HTML. # options - A instance of the GrabzItHTMLOptions class that defines any special options to use when creating the rendered HTML # sub URLToRenderedHTML($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItHTMLOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeHTML, 0, $options, $url); } # # This method specifies the HTML that should be converted into rendered HTML. # # html - The HTML to convert into rendered HTML. # options - A instance of the GrabzItHTMLOptions class that defines any special options to use when creating the rendered HTML # sub HTMLToRenderedHTML($;$) { my ($self, $html, $options) = @_; $options ||= GrabzItHTMLOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeHTML, 1, $options, $html); } # # This method specifies a HTML file that should be converted into rendered HTML. # # path - The file path of a HTML file to convert into rendered HTML. # options - A instance of the GrabzItHTMLOptions class that defines any special options to use when creating the rendered HTML. # sub FileToRenderedHTML($;$) { my ($self, $path, $options) = @_; $self->HTMLToRenderedHTML($self->_readHTMLFile($path), $options); } # # This method specifies the URL that the HTML tables should be extracted from. # # url - The URL to extract HTML tables from. # options - A instance of the GrabzItTableOptions class that defines any special options to use when converting the HTML table # sub URLToTable($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItTableOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeTable, 0, $options, $url); } # # This method specifies the HTML that the HTML tables should be extracted from. # # html - The HTML to extract HTML tables from. # options - A instance of the GrabzItTableOptions class that defines any special options to use when converting the HTML table. # sub HTMLToTable($;$) { my ($self, $html, $options) = @_; $options ||= GrabzItTableOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeTable, 1, $options, $html); } # # This method specifies a HTML file that the HTML tables should be extracted from. # # path - The file path of a HTML file to extract HTML tables from. # options - A instance of the GrabzItTableOptions class that defines any special options to use when converting the HTML table # sub FileToTable($;$) { my ($self, $path, $options) = @_; $self->HTMLToTable($self->_readHTMLFile($path), $options); } # # This method specifies the URL that should be converted into a PDF # # url - The URL to capture as a PDF # options - A instance of the GrabzItPDFOptions class that defines any special options to use when creating the PDF # sub URLToPDF($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItPDFOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakePDF, 0, $options, $url); } # # This method specifies the HTML that should be converted into a PDF. # # html - The HTML to convert into a PDF. # options - A instance of the GrabzItPDFOptions class that defines any special options to use when creating the PDF # sub HTMLToPDF($;$) { my ($self, $html, $options) = @_; $options ||= GrabzItPDFOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakePDF, 1, $options, $html); } # # This method specifies the HTML that should be converted into a PDF. # # html - The HTML to convert into a PDF. # options - A instance of the GrabzItPDFOptions class that defines any special options to use when creating the PDF. # sub FileToPDF($;$) { my ($self, $path, $options) = @_; $self->HTMLToPDF($self->_readHTMLFile($path), $options); } # # This method specifies the URL that should be converted into a DOCX # # url - The URL to capture as a DOCX # options - A instance of the GrabzItDOCXOptions class that defines any special options to use when creating the DOCX # sub URLToDOCX($;$) { my ($self, $url, $options) = @_; $options ||= GrabzItDOCXOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeDOCX, 0, $options, $url); } # # This method specifies the HTML that should be converted into a DOCX. # # html - The HTML to convert into a DOCX. # options - A instance of the GrabzItDOCXOptions class that defines any special options to use when creating the DOCX # sub HTMLToDOCX($;$) { my ($self, $html, $options) = @_; $options ||= GrabzItDOCXOptions->new(); $self->{request} = GrabzItRequest->new($self->_getRootUrl() . TakeDOCX, 1, $options, $html); } # # This method specifies the HTML that should be converted into a DOCX. # # html - The HTML to convert into a DOCX. # options - A instance of the GrabzItDOCXOptions class that defines any special options to use when creating the DOCX. # sub FileToDOCX($;$) { my ($self, $path, $options) = @_; $self->HTMLToDOCX($self->_readHTMLFile($path), $options); } # #This function attempts to Save the result asynchronously and returns a unique identifier, which can be used to get the screenshot with the GetResult #method. # #This is the recommended method of saving a file. # sub Save($) { my ($self, $callBackURL) = @_; $callBackURL ||= ''; if (length $self->{request} == 0) { die "No parameters have been set."; } $sig = $self->_encode($self->{request}->{options}->_getSignatureString($self->{_applicationSecret}, $callBackURL, $self->{request}->_getTargetUrl())); $obj = $self->_take($sig, $callBackURL); if ($obj eq "") { $obj = $self->_take($sig, $callBackURL); } return $self->_getResultValue($obj, 'ID'); } sub _take($$) { my ($self, $sig, $callBackURL) = @_; if ($self->{request}->{"isPost"} == 1) { return $self->_post($self->{request}->{url}, $self->{request}->{options}->_getParameters($self->{_applicationKey}, $sig, $callBackURL, 'html', uri_escape($self->{request}->{data}))); } my $uri = URI->new($self->{request}->{url}); $uri->query_form($self->{request}->{options}->_getParameters($self->{_applicationKey}, $sig, $callBackURL, 'url', $self->{request}->{data})); return $self->_get($uri); } # #Calls the GrabzIt web service to take the screenshot and saves it to the target path provided. if no target path is provided #it returns the screenshot byte data. # #WARNING this method is synchronous so will cause a application to pause while the result is processed. # #This function returns the true if it is successful saved to a file, or if it is not saving to a file byte data is returned, #otherwise the method throws an exception. # sub SaveTo($) { my ($self, $saveToFile) = @_; $saveToFile ||= ''; my $id = $self->Save(); if ($id eq '') { return 0; } #Wait for it to be possibly ready sleep(int((3000 + $self->{request}->{options}->{"delay"}) / 1000)); #Wait for it to be ready. while(1) { $status = $self->GetStatus($id); if (!$status->getCached() && !$status->getProcessing()) { die "The capture did not complete with the error: " . $status->getMessage()."\n"; last; } elsif ($status->getCached()) { $result = $self->GetResult($id); if (!$result) { die "The capture could not be found on GrabzIt.\n"; last; } if ($saveToFile eq '') { return $result; } open FILE, ">".File::Spec->catfile($saveToFile) or die $!."\n"; binmode FILE; print FILE $result; close FILE; last; } sleep(3); } return 1; } # #This method returns the screenshot itself. If nothing is returned then something has gone wrong or the screenshot is not ready yet. # #id - The unique identifier of the screenshot, returned by the callback handler or the Save method # #This function returns the screenshot # sub GetResult($) { my ($self, $id) = @_; $id ||= ''; if ($id eq '') { return; } my $url = $self->_getRootUrl() . "getfile?id=" . $id; return $self->_get($url); } # #Get the current status of a GrabzIt screenshot # #id - The id of the screenshot # #This function returns a Status object representing the screenshot # sub GetStatus($) { my ($self, $id) = @_; $id ||= ''; if ($id eq '') { return; } my $url = $self->_getRootUrl() . "getstatus?id=" . $id; my $result = $self->_get($url); die "Could not contact GrabzIt\n" unless defined $result; my $xml = XML::Twig->new(); $xml->parse($result); $data = $xml->root; return ScreenShotStatus->new(($data->first_child_text('Processing') eq GrabzItClient::TrueString), ($data->first_child_text('Cached') eq GrabzItClient::TrueString), ($data->first_child_text('Expired') eq GrabzItClient::TrueString), $data->first_child_text('Message')); } # #Get all the cookies that GrabzIt is using for a particular domain. This may include your user set cookies as well. # #domain - The domain to return cookies for. # #This function returns an array of cookies # sub GetCookies($) { my ($self, $domain) = @_; $sig = $self->_encode($self->{_applicationSecret}."|".$domain); $qs = "key=" .$self->{_applicationKey}."&domain=".uri_escape($domain)."&sig=".$sig; my $url = $self->_getRootUrl() . "getcookies?" . $qs; my $result = $self->_get($url); die "Could not contact GrabzIt\n" unless defined $result; my $xml = XML::Twig->new(); $xml->parse($result); $data = $xml->root; my $message = $data->first_child_text('Message'); if($message ne '') { die $message."\n"; } my @result = (); my @cookies = $data->first_child('Cookies')->children('Cookie'); foreach my $cookie (@cookies) { $grabzItCookie = GrabzItCookie->new($cookie->first_child_text('Name'), $cookie->first_child_text('Value'), $cookie->first_child_text('Domain'), $cookie->first_child_text('Path'), $cookie->first_child_text('HttpOnly'), $cookie->first_child_text('Expires'), $cookie->first_child_text('Type')); push(@result, $grabzItCookie); } return \@result; } # #Sets a new custom cookie on GrabzIt, if the custom cookie has the same name and domain as a global cookie the global #cookie is overridden. # #This can be useful if a websites functionality is controlled by cookies. # #name - The name of the cookie to set. #domain - The domain of the website to set the cookie for. #value - The value of the cookie. #path - The website path the cookie relates to. #httponly - Is the cookie only used on HTTP #expires - When the cookie expires. Pass a empty ('') value if it does not expire. # #This function returns true if the cookie was successfully set. # sub SetCookie($$;$$$$) { my ($self, $name, $domain, $value, $path, $httponly, $expires) = @_; $name ||= ''; $domain ||= ''; $value ||= ''; $path ||= "/"; $httponly ||= 0; $expires ||= ''; $sig = $self->_encode($self->{_applicationSecret}."|".$name."|".$domain."|".$value."|".$path."|".$httponly."|".$expires."|0"); $qs = "key=" .$self->{_applicationKey}."&domain=".uri_escape($domain)."&name=".uri_escape($name)."&value=".uri_escape($value)."&path=".uri_escape($path)."&httponly=".$httponly."&expires=".uri_escape($expires)."&sig=".$sig; my $url = $self->_getRootUrl() . "setcookie?" . $qs; return ($self->_getResultValue($self->_get($url), 'Result') eq GrabzItClient::TrueString); } # #Delete a custom cookie or block a global cookie from being used. # #name - The name of the cookie to delete #domain - The website the cookie belongs to # #This function returns true if the cookie was successfully set. # sub DeleteCookie($$) { my ($self, $name, $domain) = @_; $sig = $self->_encode($self->{_applicationSecret}."|".$name."|".$domain."|1"); $qs = "key=" .$self->{_applicationKey}."&domain=".uri_escape($domain)."&name=".uri_escape($name)."&delete=1&sig=".$sig; my $url = $self->_getRootUrl() . "setcookie?" . $qs; return ($self->_getResultValue($self->_get($url), 'Result') eq GrabzItClient::TrueString); } # #Add a new custom watermark. # #identifier - The identifier you want to give the custom watermark. It is important that this identifier is unique. #path - The absolute path of the watermark on your server. For instance C:/watermark/1.png #xpos - The horizontal position you want the screenshot to appear at: Left = 0, Center = 1, Right = 2 #ypos - The vertical position you want the screenshot to appear at: Top = 0, Middle = 1, Bottom = 2 # #This function returns true if the watermark was successfully set. # sub AddWaterMark($$$$) { my ($self, $identifier, $path, $xpos, $ypos) = @_; $xpos ||= 0; $ypos ||= 0; unless (-e $path) { die "File: " . $path . " does not exist\n"; } $sig = $self->_encode($self->{_applicationSecret}."|".$identifier."|".$xpos."|".$ypos); open FILE, $path or die "Couldn't open file: $!"; binmode FILE; local $/; $data = ; close FILE; $ua = LWP::UserAgent->new(); $req = POST $self->{protocol} . WebServicesBaseURL . 'addwatermark', content_type => 'multipart/form-data', content => [ key => $self->{_applicationKey}, identifier => $identifier, xpos => $xpos, ypos => $ypos, sig => $sig, watermark => [undef, basename($path), content_type => 'image/jpeg', content => $data, ] ]; return $self->_getResultValue($self->_handleResponse($ua->request($req)), 'Result'); } # #Get your uploaded custom watermark # #identifier - The identifier of a particular custom watermark you want to view # #This function returns an array of GrabzItWaterMark # sub GetWaterMark($) { my ($self, $identifier) = @_; return $self->_getWaterMarks($identifier); } # #Get your custom watermarks # #This function returns an array of GrabzItWaterMark # sub GetWaterMarks() { my ($self) = @_; return $self->_getWaterMarks(""); } sub _getWaterMarks($) { my ($self, $identifier) = @_; $identifier ||= ''; $sig = $self->_encode($self->{_applicationSecret}."|".$identifier); $qs = "key=" .uri_escape($self->{_applicationKey})."&identifier=".uri_escape($identifier)."&sig=".$sig; my $url = $self->_getRootUrl() . "getwatermarks?" . $qs; my $result = $self->_get($url); die "Could not contact GrabzIt\n" unless defined $result; my $xml = XML::Twig->new(); $xml->parse($result); $data = $xml->root; my $message = $data->first_child_text('Message'); if($message ne '') { die $message."\n"; } my @result = (); my @watermarks = $data->first_child('WaterMarks')->children('WaterMark'); foreach my $watermark (@watermarks) { $grabzItWaterMark = GrabzItWaterMark->new($watermark->first_child_text('Identifier'), $watermark->first_child_text('XPosition'), $watermark->first_child_text('YPosition'), $watermark->first_child_text('Format')); push(@result, $grabzItWaterMark); } return \@result; } # #Delete a custom watermark. # #identifier - The identifier of the custom watermark you want to delete # #This function returns true if the watermark was successfully deleted. # sub DeleteWaterMark($) { my ($self, $identifier) = @_; $sig = $self->_encode($self->{_applicationSecret}."|".$identifier); $qs = "key=" .uri_escape($self->{_applicationKey})."&identifier=".uri_escape($identifier)."&sig=".$sig; my $url = $self->_getRootUrl() . "deletewatermark?" . $qs; return ($self->_getResultValue($self->_get($url), 'Result') eq GrabzItClient::TrueString); } # #This method sets if requests to GrabzIt's API should use SSL or not # #value - true if should use SSL # sub UseSSL($) { my ($self, $value) = @_; if ($value) { $self->{protocol} = "https"; return; } $self->{protocol} = "http"; } sub _getRootUrl() { my ($self) = @_; return $self->{protocol} . WebServicesBaseURL; } sub _encode($) { my ($self, $text) = @_; $text = decode_utf8($text); $text =~ s/[^\x00-\x7F]/?/g; return md5_hex($text); } sub _get($) { my ($self, $url) = @_; $ua = LWP::UserAgent->new(); $ua->timeout(600); return $self->_handleResponse($ua->get($url)); } sub _post($$) { my ($self, $url, $params) = @_; $ua = LWP::UserAgent->new(); $ua->timeout(600); return $self->_handleResponse($ua->post($url, $params)); } sub _handleResponse($) { my ($self, $response) = @_; if ($response->code == 403) { die 'Rate limit reached. Please wait for your service to resume shortly. Also please slow the rate of requests you are sending to GrabzIt to ensure this does not happen in the future.'; } elsif ($response->code >= 400) { die 'A network error occurred when connecting to GrabzIt.'; } return $response->decoded_content; } sub _getResultValue($$) { my ($self, $result, $elementId) = @_; die "Could not contact GrabzIt\n" unless defined $result; my $xml = XML::Twig->new(); $xml->parse($result); $data = $xml->root; $message = $data->first_child_text('Message'); if($message ne '') { die $message."\n"; } return $data->first_child_text($elementId); } sub _readHTMLFile($) { my ($self, $path) = @_; unless (-e $path) { die "File: " . $path . " does not exist\n"; } open FILE, $path or die "Couldn't open file: $!"; binmode FILE; local $/; $data = ; close FILE; return $data; } 1;GrabzItClient-3.5.7/GrabzItCookie.pm000666 000000 000000 00000001733 13766733233 015454 0ustar00000000 000000 #!/usr/bin/perl package GrabzItCookie; sub new { my $class = shift; my $self = { _name => shift, _value => shift, _domain => shift, _path => shift, _httponly => shift, _expires => shift, _type => shift, }; bless $self, $class; return $self; } sub getName { my ($self) = @_; return $self->{_name}; } sub getValue { my ($self) = @_; return $self->{_value}; } sub getDomain { my ($self) = @_; return $self->{_domain}; } sub getPath { my ($self) = @_; return $self->{_path}; } sub getHttpOnly { my ($self) = @_; return $self->{_httponly}; } sub getExpires { my ($self) = @_; return $self->{_expires}; } sub getType { my ($self) = @_; return $self->{_type}; } 1;GrabzItClient-3.5.7/GrabzItDOCXOptions.pm000666 000000 000000 00000025514 14560247315 016351 0ustar00000000 000000 #!/usr/bin/perl package GrabzItDOCXOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"includeBackground"} = 1; $self->{"pagesize"} = "A4"; $self->{"orientation"} = "Portrait"; $self->{"includeLinks"} = 1; $self->{"includeImages"} = 1; $self->{"title"} = ''; $self->{"marginTop"} = 10; $self->{"marginLeft"} = 10; $self->{"marginBottom"} = 10; $self->{"marginRight"} = 10; $self->{"requestAs"} = 0; $self->{"quality"} = -1; $self->{"hideElement"} = ''; $self->{"waitForElement"} = ''; $self->{"noAds"} = 0; $self->{"templateVariables"} = ''; $self->{"width"} = 0; $self->{"height"} = 0; $self->{"templateId"} = ''; $self->{"targetElement"} = ''; $self->{"browserWidth"} = 0; $self->{"mergeId"} = ''; $self->{"address"} = ''; $self->{"noCookieNotifications"} = 0; $self->{"password"} = ''; $self->{"clickElement"} = ''; bless $self, $class; return $self; } # # True if the background images of the web page should be included in the DOCX # sub includeBackground { my $self = shift; if (scalar(@_) == 1) { $self->{"includeBackground"} = shift; } return $self->{"includeBackground"}; } # # The page size of the DOCX to be returned: 'A3', 'A4', 'A5', 'A6', 'B3', 'B4', 'B5', 'B6', 'Letter' # sub pagesize { my $self = shift; if (scalar(@_) == 1) { $self->{"pagesize"} = uc(shift); } return $self->{"pagesize"}; } # # The orientation of the DOCX to be returned: 'Landscape' or 'Portrait' # sub orientation { my $self = shift; if (scalar(@_) == 1) { $self->{"orientation"} = ucfirst(shift); } return $self->{"orientation"}; } # # True if links should be included in the DOCX # sub includeLinks { my $self = shift; if (scalar(@_) == 1) { $self->{"includeLinks"} = shift; } return $self->{"includeLinks"}; } # # True if the images of the web page should be included in the DOCX # sub includeImages { my $self = shift; if (scalar(@_) == 1) { $self->{"includeImages"} = shift; } return $self->{"includeImages"}; } # # Title for the DOCX document # sub title { my $self = shift; if (scalar(@_) == 1) { $self->{"title"} = shift; } return $self->{"title"}; } # # The margin that should appear at the top of the DOCX document page # sub marginTop { my $self = shift; if (scalar(@_) == 1) { $self->{"marginTop"} = shift; } return $self->{"marginTop"}; } # # The margin that should appear at the left of the DOCX document page # sub marginLeft { my $self = shift; if (scalar(@_) == 1) { $self->{"marginLeft"} = shift; } return $self->{"marginLeft"}; } # # The margin that should appear at the bottom of the DOCX document page # sub marginBottom { my $self = shift; if (scalar(@_) == 1) { $self->{"marginBottom"} = shift; } return $self->{"marginBottom"}; } # # The margin that should appear at the right of the DOCX document # sub marginRight { my $self = shift; if (scalar(@_) == 1) { $self->{"marginRight"} = shift; } return $self->{"marginRight"}; } # # The number of milliseconds to wait before creating the capture # sub delay { my $self = shift; if (scalar(@_) == 1) { $self->{"delay"} = shift; } return $self->{"delay"}; } # # The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3 # sub requestAs { my $self = shift; if (scalar(@_) == 1) { $self->{"requestAs"} = shift; } return $self->{"requestAs"}; } # # The quality of the DOCX where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality # sub quality { my $self = shift; if (scalar(@_) == 1) { $self->{"quality"} = shift; } return $self->{"quality"}; } # # The CSS selector of the HTML element in the web page to click # sub clickElement { my $self = shift; if (scalar(@_) == 1) { $self->{"clickElement"} = shift; } return $self->{"clickElement"}; } # # The CSS selector(s) of the one or more HTML elements in the web page to hide # sub hideElement { my $self = shift; if (scalar(@_) == 1) { $self->{"hideElement"} = shift; } return $self->{"hideElement"}; } # # The CSS selector of the HTML element in the web page that must be visible before the capture is performed # sub waitForElement { my $self = shift; if (scalar(@_) == 1) { $self->{"waitForElement"} = shift; } return $self->{"waitForElement"}; } # # True if adverts should be automatically hidden. # sub noAds { my $self = shift; if (scalar(@_) == 1) { $self->{"noAds"} = shift; } return $self->{"noAds"}; } # # True if cookie notification should be automatically hidden. # sub noCookieNotifications { my $self = shift; if (scalar(@_) == 1) { $self->{"noCookieNotifications"} = shift; } return $self->{"noCookieNotifications"}; } # # The URL to execute the HTML code in. # sub address { my $self = shift; if (scalar(@_) == 1) { $self->{"address"} = shift; } return $self->{"address"}; } # # Protect the DOCX document with this password # sub password { my $self = shift; if (scalar(@_) == 1) { $self->{"password"} = shift; } return $self->{"password"}; } # # The width of the browser in pixels # sub browserWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"browserWidth"} = shift; } return $self->{"browserWidth"}; } # # The width of the DOCX in mm # sub pageWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"width"} = shift; } return $self->{"width"}; } # # The height of the DOCX in mm # sub pageHeight { my $self = shift; if (scalar(@_) == 1) { $self->{"height"} = shift; } return $self->{"height"}; } # # The PDF template ID that specifies the header and footer of the PDF document # sub templateId { my $self = shift; if (scalar(@_) == 1) { $self->{"templateId"} = shift; } return $self->{"templateId"}; } # # The ID of a capture that should be merged at the beginning of the new DOCX document # sub mergeId { my $self = shift; if (scalar(@_) == 1) { $self->{"mergeId"} = shift; } return $self->{"mergeId"}; } # # The CSS selector of the only HTML element in the web page to capture # sub targetElement { my $self = shift; if (scalar(@_) == 1) { $self->{"targetElement"} = shift; } return $self->{"targetElement"}; } # #Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force #GrabzIt to perform a HTTP post. # #name - The name of the HTTP Post parameter. #value - The value of the HTTP Post parameter # sub AddPostParameter($$) { my ($self, $name, $value) = @_; $self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value); } # #Define a custom Template parameter and value, this method can be called multiple times to add multiple parameters. # #name - The name of the template parameter #value - The value of the template parameter # sub AddTemplateParameter($$) { my ($self, $name, $value) = @_; $self->{"templateVariables"} = $self->_appendPostParameter($self->{"templateVariables"}, $name, $value); } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->customId() ."|".$self->includeBackground() ."|".$self->pagesize() ."|".$self->orientation()."|".$self->includeImages()."|".$self->includeLinks()."|".$self->title()."|".$self->marginTop()."|".$self->marginLeft()."|".$self->marginBottom()."|".$self->marginRight(). "|".$self->delay()."|".$self->requestAs()."|".$self->country()."|".$self->quality()."|".$self->hideElement()."|".$self->exportURL()."|". $self->waitForElement()."|".$self->encryptionKey()."|".$self->noAds()."|".$self->{"post"}."|".$self->targetElement()."|".$self->templateId()."|". $self->{"templateVariables"}."|".$self->pageHeight()."|".$self->pageWidth()."|".$self->browserWidth()."|".$self->proxy()."|".$self->mergeId(). "|".$self->address()."|".$self->noCookieNotifications()."|".$self->password()."|".$self->clickElement(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'background'} = $self->includeBackground(); $params->{'pagesize'} = $self->pagesize(); $params->{'orientation'} = $self->orientation(); $params->{'includelinks'} = $self->includeLinks(); $params->{'includeimages'} = $self->includeImages(); $params->{'title'} = $self->title(); $params->{'mleft'} = $self->marginLeft(); $params->{'mright'} = $self->marginRight(); $params->{'mtop'} = $self->marginTop(); $params->{'mbottom'} = $self->marginBottom(); $params->{'delay'} = $self->delay(); $params->{'requestmobileversion'} = $self->requestAs(); $params->{'quality'} = $self->quality(); $params->{'hide'} = $self->hideElement(); $params->{'waitfor'} = $self->waitForElement(); $params->{'noads'} = $self->noAds(); $params->{'post'} = $self->{"post"}; $params->{'bwidth'} = $self->browserWidth(); $params->{'width'} = $self->pageWidth(); $params->{'height'} = $self->pageHeight(); $params->{'tvars'} = $self->{"templateVariables"}; $params->{'target'} = $self->targetElement(); $params->{'templateid'} = $self->templateId(); $params->{'mergeid'} = $self->mergeId(); $params->{'nonotify'} = $self->noCookieNotifications(); $params->{'address'} = $self->address(); $params->{'password'} = $self->password(); $params->{'click'} = $self->clickElement(); return $params; } 1;GrabzItClient-3.5.7/GrabzItHTMLOptions.pm000666 000000 000000 00000010404 14560247316 016351 0ustar00000000 000000 #!/usr/bin/perl package GrabzItHTMLOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"browserWidth"} = 0; $self->{"browserHeight"} = 0; $self->{"waitForElement"} = ''; $self->{"requestAs"} = 0; $self->{"noAds"} = 0; $self->{"address"} = ''; $self->{"noCookieNotifications"} = 0; bless $self, $class; return $self; } # # The width of the browser in pixels # sub browserWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"browserWidth"} = shift; } return $self->{"browserWidth"}; } # # The height of the browser in pixels. Use -1 to screenshot the whole web page # sub browserHeight { my $self = shift; if (scalar(@_) == 1) { $self->{"browserHeight"} = shift; } return $self->{"browserHeight"}; } # # The number of milliseconds to wait before creating the capture # sub delay { my $self = shift; if (scalar(@_) == 1) { $self->{"delay"} = shift; } return $self->{"delay"}; } # # The CSS selector of the HTML element in the web page that must be visible before the capture is performed # sub waitForElement { my $self = shift; if (scalar(@_) == 1) { $self->{"waitForElement"} = shift; } return $self->{"waitForElement"}; } # # The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3 # sub requestAs { my $self = shift; if (scalar(@_) == 1) { $self->{"requestAs"} = shift; } return $self->{"requestAs"}; } # # True if adverts should be automatically hidden. # sub noAds { my $self = shift; if (scalar(@_) == 1) { $self->{"noAds"} = shift; } return $self->{"noAds"}; } # # True if cookie notification should be automatically hidden. # sub noCookieNotifications { my $self = shift; if (scalar(@_) == 1) { $self->{"noCookieNotifications"} = shift; } return $self->{"noCookieNotifications"}; } # # The URL to execute the HTML code in. # sub address { my $self = shift; if (scalar(@_) == 1) { $self->{"address"} = shift; } return $self->{"address"}; } # #Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force #GrabzIt to perform a HTTP post. # #name - The name of the HTTP Post parameter. #value - The value of the HTTP Post parameter # sub AddPostParameter($$) { my ($self, $name, $value) = @_; $self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value); } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->browserHeight()."|".$self->browserWidth()."|".$self->customId()."|".$self->delay(). "|".$self->requestAs()."|".$self->country()."|".$self->exportURL()."|".$self->waitForElement()."|".$self->encryptionKey()."|".$self->noAds()."|".$self->{"post"}."|".$self->proxy()."|".$self->address()."|".$self->noCookieNotifications(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'bwidth'} = $self->browserWidth(); $params->{'bheight'} = $self->browserHeight(); $params->{'delay'} = $self->delay(); $params->{'requestmobileversion'} = $self->requestAs(); $params->{'waitfor'} = $self->waitForElement(); $params->{'noads'} = $self->noAds(); $params->{'post'} = $self->{"post"}; $params->{'nonotify'} = $self->noCookieNotifications(); $params->{'address'} = $self->address(); return $params; } 1;GrabzItClient-3.5.7/GrabzItImageOptions.pm000666 000000 000000 00000017337 14560247131 016636 0ustar00000000 000000 #!/usr/bin/perl package GrabzItImageOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"browserWidth"} = 0; $self->{"browserHeight"} = 0; $self->{"width"} = 0; $self->{"height"} = 0; $self->{"format"} = ''; $self->{"targetElement"} = ''; $self->{"hideElement"} = ''; $self->{"waitForElement"} = ''; $self->{"requestAs"} = 0; $self->{"customWaterMarkId"} = ''; $self->{"quality"} = -1; $self->{"transparent"} = 0; $self->{"noAds"} = 0; $self->{"address"} = ''; $self->{"noCookieNotifications"} = 0; $self->{"hd"} = 0; $self->{"clickElement"} = ''; bless $self, $class; return $self; } # # The width of the browser in pixels # sub browserWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"browserWidth"} = shift; } return $self->{"browserWidth"}; } # # The height of the browser in pixels. Use -1 to screenshot the whole web page # sub browserHeight { my $self = shift; if (scalar(@_) == 1) { $self->{"browserHeight"} = shift; } return $self->{"browserHeight"}; } # # The width of the resulting screenshot in pixels. Use -1 to not reduce the width of the screenshot # sub width { my $self = shift; if (scalar(@_) == 1) { $self->{"width"} = shift; } return $self->{"width"}; } # # The height of the resulting screenshot in pixels. Use -1 to not reduce the height of the screenshot # sub height { my $self = shift; if (scalar(@_) == 1) { $self->{"height"} = shift; } return $self->{"height"}; } # # The format the screenshot should be in: bmp8, bmp16, bmp24, bmp, tiff, jpg, png # sub format { my $self = shift; if (scalar(@_) == 1) { $self->{"format"} = shift; } return $self->{"format"}; } # # The number of milliseconds to wait before creating the capture # sub delay { my $self = shift; if (scalar(@_) == 1) { $self->{"delay"} = shift; } return $self->{"delay"}; } # # The CSS selector of the HTML element in the web page to click # sub clickElement { my $self = shift; if (scalar(@_) == 1) { $self->{"clickElement"} = shift; } return $self->{"clickElement"}; } # # The CSS selector of the only HTML element in the web page to capture # sub targetElement { my $self = shift; if (scalar(@_) == 1) { $self->{"targetElement"} = shift; } return $self->{"targetElement"}; } # # The CSS selector(s) of the one or more HTML elements in the web page to hide # sub hideElement { my $self = shift; if (scalar(@_) == 1) { $self->{"hideElement"} = shift; } return $self->{"hideElement"}; } # # The CSS selector of the HTML element in the web page that must be visible before the capture is performed # sub waitForElement { my $self = shift; if (scalar(@_) == 1) { $self->{"waitForElement"} = shift; } return $self->{"waitForElement"}; } # # The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3 # sub requestAs { my $self = shift; if (scalar(@_) == 1) { $self->{"requestAs"} = shift; } return $self->{"requestAs"}; } # # The custom watermark to add to the screenshot # sub customWaterMarkId { my $self = shift; if (scalar(@_) == 1) { $self->{"customWaterMarkId"} = shift; } return $self->{"customWaterMarkId"}; } # # The quality of the screenshot where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality # sub quality { my $self = shift; if (scalar(@_) == 1) { $self->{"quality"} = shift; } return $self->{"quality"}; } # # True if the image capture should be transparent. This is only compatible with png and tiff images # sub transparent { my $self = shift; if (scalar(@_) == 1) { $self->{"transparent"} = shift; } return $self->{"transparent"}; } # # True if the image capture should be in high definition. # sub hd { my $self = shift; if (scalar(@_) == 1) { $self->{"hd"} = shift; } return $self->{"hd"}; } # # True if adverts should be automatically hidden. # sub noAds { my $self = shift; if (scalar(@_) == 1) { $self->{"noAds"} = shift; } return $self->{"noAds"}; } # # True if cookie notification should be automatically hidden. # sub noCookieNotifications { my $self = shift; if (scalar(@_) == 1) { $self->{"noCookieNotifications"} = shift; } return $self->{"noCookieNotifications"}; } # # The URL to execute the HTML code in. # sub address { my $self = shift; if (scalar(@_) == 1) { $self->{"address"} = shift; } return $self->{"address"}; } # #Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force #GrabzIt to perform a HTTP post. # #name - The name of the HTTP Post parameter. #value - The value of the HTTP Post parameter # sub AddPostParameter($$) { my ($self, $name, $value) = @_; $self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value); } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->format()."|".$self->height()."|".$self->width()."|".$self->browserHeight()."|".$self->browserWidth()."|".$self->customId()."|".$self->delay(). "|".$self->targetElement()."|".$self->customWaterMarkId()."|".$self->requestAs()."|".$self->country()."|".$self->quality()."|".$self->hideElement()."|".$self->exportURL()."|".$self->waitForElement()."|".$self->transparent()."|".$self->encryptionKey()."|".$self->noAds()."|".$self->{"post"}."|".$self->proxy()."|".$self->address()."|".$self->noCookieNotifications()."|".$self->hd(). "|".$self->clickElement(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'width'} = $self->width(); $params->{'height'} = $self->height(); $params->{'format'} = $self->format(); $params->{'bwidth'} = $self->browserWidth(); $params->{'bheight'} = $self->browserHeight(); $params->{'delay'} = $self->delay(); $params->{'target'} = $self->targetElement(); $params->{'hide'} = $self->hideElement(); $params->{'customwatermarkid'} = $self->customWaterMarkId(); $params->{'requestmobileversion'} = $self->requestAs(); $params->{'quality'} = $self->quality(); $params->{'waitfor'} = $self->waitForElement(); $params->{'transparent'} = $self->transparent(); $params->{'noads'} = $self->noAds(); $params->{'post'} = $self->{"post"}; $params->{'nonotify'} = $self->noCookieNotifications(); $params->{'address'} = $self->address(); $params->{'hd'} = $self->hd(); $params->{'click'} = $self->clickElement(); return $params; } 1;GrabzItClient-3.5.7/GrabzItPDFOptions.pm000666 000000 000000 00000027547 14560247135 016235 0ustar00000000 000000 #!/usr/bin/perl package GrabzItPDFOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"browserWidth"} = 0; $self->{"includeBackground"} = 1; $self->{"pagesize"} = "A4"; $self->{"orientation"} = "Portrait"; $self->{"includeLinks"} = 1; $self->{"includeOutline"} = 0; $self->{"title"} = ''; $self->{"coverURL"} = ''; $self->{"marginTop"} = 10; $self->{"marginLeft"} = 10; $self->{"marginBottom"} = 10; $self->{"marginRight"} = 10; $self->{"requestAs"} = 0; $self->{"customWaterMarkId"} = ''; $self->{"quality"} = -1; $self->{"templateId"} = ''; $self->{"targetElement"} = ''; $self->{"hideElement"} = ''; $self->{"waitForElement"} = ''; $self->{"noAds"} = 0; $self->{"templateVariables"} = ''; $self->{"width"} = 0; $self->{"height"} = 0; $self->{"mergeId"} = ''; $self->{"address"} = ''; $self->{"noCookieNotifications"} = 0; $self->{"cssMediaType"} = ''; $self->{"password"} = ''; $self->{"clickElement"} = ''; bless $self, $class; return $self; } # # True if the background of the web page should be included in the PDF # sub includeBackground { my $self = shift; if (scalar(@_) == 1) { $self->{"includeBackground"} = shift; } return $self->{"includeBackground"}; } # # The page size of the PDF to be returned: 'A3', 'A4', 'A5', 'A6', 'B3', 'B4', 'B5', 'B6', 'Letter' # sub pagesize { my $self = shift; if (scalar(@_) == 1) { $self->{"pagesize"} = uc(shift); } return $self->{"pagesize"}; } # # The orientation of the PDF to be returned: 'Landscape' or 'Portrait' # sub orientation { my $self = shift; if (scalar(@_) == 1) { $self->{"orientation"} = ucfirst(shift); } return $self->{"orientation"}; } # # The CSS Media Type of the PDF to be returned: 'Print' or 'Screen' # sub cssMediaType { my $self = shift; if (scalar(@_) == 1) { $self->{"cssMediaType"} = ucfirst(shift); } return $self->{"cssMediaType"}; } # # Protect the PDF document with this password # sub password { my $self = shift; if (scalar(@_) == 1) { $self->{"password"} = shift; } return $self->{"password"}; } # # True if links should be included in the PDF # sub includeLinks { my $self = shift; if (scalar(@_) == 1) { $self->{"includeLinks"} = shift; } return $self->{"includeLinks"}; } # # True if the PDF outline should be included # sub includeOutline { my $self = shift; if (scalar(@_) == 1) { $self->{"includeOutline"} = shift; } return $self->{"includeOutline"}; } # # Title for the PDF document # sub title { my $self = shift; if (scalar(@_) == 1) { $self->{"title"} = shift; } return $self->{"title"}; } # # The URL of a web page that should be used as a cover page for the PDF # sub coverURL { my $self = shift; if (scalar(@_) == 1) { $self->{"coverURL"} = shift; } return $self->{"coverURL"}; } # # The margin that should appear at the top of the PDF document page # sub marginTop { my $self = shift; if (scalar(@_) == 1) { $self->{"marginTop"} = shift; } return $self->{"marginTop"}; } # # The margin that should appear at the left of the PDF document page # sub marginLeft { my $self = shift; if (scalar(@_) == 1) { $self->{"marginLeft"} = shift; } return $self->{"marginLeft"}; } # # The margin that should appear at the bottom of the PDF document page # sub marginBottom { my $self = shift; if (scalar(@_) == 1) { $self->{"marginBottom"} = shift; } return $self->{"marginBottom"}; } # # The margin that should appear at the right of the PDF document # sub marginRight { my $self = shift; if (scalar(@_) == 1) { $self->{"marginRight"} = shift; } return $self->{"marginRight"}; } # # The width of the browser in pixels # sub browserWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"browserWidth"} = shift; } return $self->{"browserWidth"}; } # # The width of the PDF in mm # sub pageWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"width"} = shift; } return $self->{"width"}; } # # The height of the PDF in mm # sub pageHeight { my $self = shift; if (scalar(@_) == 1) { $self->{"height"} = shift; } return $self->{"height"}; } # # The number of milliseconds to wait before creating the capture # sub delay { my $self = shift; if (scalar(@_) == 1) { $self->{"delay"} = shift; } return $self->{"delay"}; } # # The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3 # sub requestAs { my $self = shift; if (scalar(@_) == 1) { $self->{"requestAs"} = shift; } return $self->{"requestAs"}; } # # The custom watermark to add to the PDF # sub customWaterMarkId { my $self = shift; if (scalar(@_) == 1) { $self->{"customWaterMarkId"} = shift; } return $self->{"customWaterMarkId"}; } # # The quality of the PDF where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality # sub quality { my $self = shift; if (scalar(@_) == 1) { $self->{"quality"} = shift; } return $self->{"quality"}; } # # The template ID that specifies the header and footer of the PDF document # sub templateId { my $self = shift; if (scalar(@_) == 1) { $self->{"templateId"} = shift; } return $self->{"templateId"}; } # # The ID of a capture that should be merged at the beginning of the new PDF document # sub mergeId { my $self = shift; if (scalar(@_) == 1) { $self->{"mergeId"} = shift; } return $self->{"mergeId"}; } # # The CSS selector of the HTML element in the web page to click # sub clickElement { my $self = shift; if (scalar(@_) == 1) { $self->{"clickElement"} = shift; } return $self->{"clickElement"}; } # # The CSS selector of the only HTML element in the web page to capture # sub targetElement { my $self = shift; if (scalar(@_) == 1) { $self->{"targetElement"} = shift; } return $self->{"targetElement"}; } # # The CSS selector(s) of the one or more HTML elements in the web page to hide # sub hideElement { my $self = shift; if (scalar(@_) == 1) { $self->{"hideElement"} = shift; } return $self->{"hideElement"}; } # # The CSS selector of the HTML element in the web page that must be visible before the capture is performed # sub waitForElement { my $self = shift; if (scalar(@_) == 1) { $self->{"waitForElement"} = shift; } return $self->{"waitForElement"}; } # # True if adverts should be automatically hidden. # sub noAds { my $self = shift; if (scalar(@_) == 1) { $self->{"noAds"} = shift; } return $self->{"noAds"}; } # # True if cookie notification should be automatically hidden. # sub noCookieNotifications { my $self = shift; if (scalar(@_) == 1) { $self->{"noCookieNotifications"} = shift; } return $self->{"noCookieNotifications"}; } # # The URL to execute the HTML code in. # sub address { my $self = shift; if (scalar(@_) == 1) { $self->{"address"} = shift; } return $self->{"address"}; } # #Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force #GrabzIt to perform a HTTP post. # #name - The name of the HTTP Post parameter. #value - The value of the HTTP Post parameter # sub AddPostParameter($$) { my ($self, $name, $value) = @_; $self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value); } # #Define a custom Template parameter and value, this method can be called multiple times to add multiple parameters. # #name - The name of the template parameter #value - The value of the template parameter # sub AddTemplateParameter($$) { my ($self, $name, $value) = @_; $self->{"templateVariables"} = $self->_appendPostParameter($self->{"templateVariables"}, $name, $value); } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->customId() ."|".$self->includeBackground() ."|".$self->pagesize() ."|".$self->orientation()."|".$self->customWaterMarkId()."|".$self->includeLinks(). "|".$self->includeOutline()."|".$self->title()."|".$self->coverURL()."|".$self->marginTop()."|".$self->marginLeft()."|".$self->marginBottom()."|".$self->marginRight(). "|".$self->delay()."|".$self->requestAs()."|".$self->country()."|".$self->quality()."|".$self->templateId()."|".$self->hideElement(). "|".$self->targetElement()."|".$self->exportURL()."|".$self->waitForElement()."|".$self->encryptionKey()."|".$self->noAds()."|".$self->{"post"}. "|".$self->browserWidth()."|".$self->pageHeight()."|".$self->pageWidth()."|".$self->{"templateVariables"}."|".$self->proxy()."|".$self->mergeId(). "|".$self->address()."|".$self->noCookieNotifications()."|".$self->cssMediaType()."|".$self->password()."|".$self->clickElement(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'background'} = $self->includeBackground(); $params->{'pagesize'} = $self->pagesize(); $params->{'orientation'} = $self->orientation(); $params->{'templateid'} = $self->templateId(); $params->{'customwatermarkid'} = $self->customWaterMarkId(); $params->{'includelinks'} = $self->includeLinks(); $params->{'includeoutline'} = $self->includeOutline(); $params->{'title'} = $self->title(); $params->{'coverurl'} = $self->coverURL(); $params->{'mleft'} = $self->marginLeft(); $params->{'mright'} = $self->marginRight(); $params->{'mtop'} = $self->marginTop(); $params->{'mbottom'} = $self->marginBottom(); $params->{'delay'} = $self->delay(); $params->{'requestmobileversion'} = $self->requestAs(); $params->{'quality'} = $self->quality(); $params->{'target'} = $self->targetElement(); $params->{'hide'} = $self->hideElement(); $params->{'waitfor'} = $self->waitForElement(); $params->{'noads'} = $self->noAds(); $params->{'post'} = $self->{"post"}; $params->{'bwidth'} = $self->browserWidth(); $params->{'width'} = $self->pageWidth(); $params->{'height'} = $self->pageHeight(); $params->{'tvars'} = $self->{"templateVariables"}; $params->{'mergeid'} = $self->mergeId(); $params->{'nonotify'} = $self->noCookieNotifications(); $params->{'address'} = $self->address(); $params->{'media'} = $self->cssMediaType(); $params->{'password'} = $self->password(); $params->{'click'} = $self->clickElement(); return $params; } 1;GrabzItClient-3.5.7/GrabzItRequest.pm000666 000000 000000 00000000735 13766733233 015674 0ustar00000000 000000 #!/usr/bin/perl package GrabzItRequest; sub new { my $class = shift; my $self = { url => shift, isPost => shift, options => shift, data => shift, }; $self->{"data"} ||= ''; bless $self, $class; return $self; } sub _getTargetUrl() { my ($self) = @_; if ($self->{"isPost"} == 1) { return ''; } return $self->{"data"}; } 1;GrabzItClient-3.5.7/GrabzItTableOptions.pm000666 000000 000000 00000010240 14560247341 016630 0ustar00000000 000000 #!/usr/bin/perl package GrabzItTableOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"tableNumberToInclude"} = 1; $self->{"format"} = "csv"; $self->{"includeHeaderNames"} = 1; $self->{"includeAllTables"} = 1; $self->{"targetElement"} = ''; $self->{"requestAs"} = 0; $self->{"address"} = ''; bless $self, $class; return $self; } # # The index of the table to be converted, were all tables in a web page are ordered from the top of the web page to bottom # sub tableNumberToInclude { my $self = shift; if (scalar(@_) == 1) { $self->{"tableNumberToInclude"} = shift; } return $self->{"tableNumberToInclude"}; } # # The format the table should be in: csv, xlsx or json # sub format { my $self = shift; if (scalar(@_) == 1) { $self->{"format"} = shift; } return $self->{"format"}; } # # True to include header names into the table # sub includeHeaderNames { my $self = shift; if (scalar(@_) == 1) { $self->{"includeHeaderNames"} = shift; } return $self->{"includeHeaderNames"}; } # # True to extract every table on the web page into a separate spreadsheet sheet. Only available with the XLSX and JSON formats # sub includeAllTables { my $self = shift; if (scalar(@_) == 1) { $self->{"includeAllTables"} = shift; } return $self->{"includeAllTables"}; } # # The id of the only HTML element in the web page that should be used to extract tables from # sub targetElement { my $self = shift; if (scalar(@_) == 1) { $self->{"targetElement"} = shift; } return $self->{"targetElement"}; } # # The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3 # sub requestAs { my $self = shift; if (scalar(@_) == 1) { $self->{"requestAs"} = shift; } return $self->{"requestAs"}; } # # The URL to execute the HTML code in. # sub address { my $self = shift; if (scalar(@_) == 1) { $self->{"address"} = shift; } return $self->{"address"}; } # #Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force #GrabzIt to perform a HTTP post. # #name - The name of the HTTP Post parameter. #value - The value of the HTTP Post parameter # sub AddPostParameter($$) { my ($self, $name, $value) = @_; $self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value); } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->customId()."|".$self->tableNumberToInclude() ."|".$self->includeAllTables()."|".$self->includeHeaderNames()."|".$self->targetElement()."|". $self->format()."|".$self->requestAs()."|".$self->country()."|".$self->exportURL()."|".$self->encryptionKey()."|".$self->{"post"}."|".$self->proxy()."|".$self->address(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'includeAllTables'} = $self->includeAllTables(); $params->{'includeHeaderNames'} = $self->includeHeaderNames(); $params->{'format'} = $self->format(); $params->{'tableToInclude'} = $self->tableNumberToInclude(); $params->{'target'} = $self->targetElement(); $params->{'requestmobileversion'} = $self->requestAs(); $params->{'post'} = $self->{"post"}; $params->{'address'} = $self->address(); return $params; } 1;GrabzItClient-3.5.7/GrabzItVideoOptions.pm000666 000000 000000 00000014450 14611456641 016660 0ustar00000000 000000 #!/usr/bin/perl package GrabzItVideoOptions; use GrabzItBaseOptions; @ISA = qw(GrabzItBaseOptions); sub new { my $class = shift; my $self = GrabzItBaseOptions->new(@_); $self->{"browserWidth"} = 0; $self->{"browserHeight"} = 0; $self->{"width"} = 0; $self->{"height"} = 0; $self->{"start"} = 0; $self->{"duration"} = 10; $self->{"framesPerSecond"} = 0; $self->{"customWaterMarkId"} = ''; $self->{"waitForElement"} = ''; $self->{"requestAs"} = 0; $self->{"noAds"} = 0; $self->{"address"} = ''; $self->{"noCookieNotifications"} = 0; $self->{"clickElement"} = ''; bless $self, $class; return $self; } # # The width of the browser in pixels # sub browserWidth { my $self = shift; if (scalar(@_) == 1) { $self->{"browserWidth"} = shift; } return $self->{"browserWidth"}; } # # The height of the browser in pixels # sub browserHeight { my $self = shift; if (scalar(@_) == 1) { $self->{"browserHeight"} = shift; } return $self->{"browserHeight"}; } # # The width of the resulting video in pixels. # sub width { my $self = shift; if (scalar(@_) == 1) { $self->{"width"} = shift; } return $self->{"width"}; } # # The height of the resulting video in pixels. # sub height { my $self = shift; if (scalar(@_) == 1) { $self->{"height"} = shift; } return $self->{"height"}; } # # The starting time of the web page that should be converted into a video # sub start { my $self = shift; if (scalar(@_) == 1) { $self->{"start"} = shift; } return $self->{"start"}; } # # The length in seconds of the web page that should be converted into a video # sub duration { my $self = shift; if (scalar(@_) == 1) { $self->{"duration"} = shift; } return $self->{"duration"}; } # # The number of frames per second that should be used to create the video. From a minimum of 0.2 to a maximum of 10 # sub framesPerSecond { my $self = shift; if (scalar(@_) == 1) { $self->{"framesPerSecond"} = shift; } return $self->{"framesPerSecond"}; } # # The custom watermark to add to the video # sub customWaterMarkId { my $self = shift; if (scalar(@_) == 1) { $self->{"customWaterMarkId"} = shift; } return $self->{"customWaterMarkId"}; } # # The CSS selector of the HTML element in the web page that must be visible before the capture is performed # sub waitForElement { my $self = shift; if (scalar(@_) == 1) { $self->{"waitForElement"} = shift; } return $self->{"waitForElement"}; } # # The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3 # sub requestAs { my $self = shift; if (scalar(@_) == 1) { $self->{"requestAs"} = shift; } return $self->{"requestAs"}; } # # True if adverts should be automatically hidden. # sub noAds { my $self = shift; if (scalar(@_) == 1) { $self->{"noAds"} = shift; } return $self->{"noAds"}; } # # True if cookie notification should be automatically hidden. # sub noCookieNotifications { my $self = shift; if (scalar(@_) == 1) { $self->{"noCookieNotifications"} = shift; } return $self->{"noCookieNotifications"}; } # # The URL to execute the HTML code in. # sub address { my $self = shift; if (scalar(@_) == 1) { $self->{"address"} = shift; } return $self->{"address"}; } # # The CSS selector of the HTML element in the web page to click # sub clickElement { my $self = shift; if (scalar(@_) == 1) { $self->{"clickElement"} = shift; } return $self->{"clickElement"}; } # #Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force #GrabzIt to perform a HTTP post. # #name - The name of the HTTP Post parameter. #value - The value of the HTTP Post parameter # sub AddPostParameter($$) { my ($self, $name, $value) = @_; $self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value); } sub _getSignatureString($$;$) { my ($self, $applicationSecret, $callBackURL, $url) = @_; $url ||= ''; $urlParam = ''; if ($url ne '') { $urlParam = $url."|"; } $callBackURLParam = ''; if ($callBackURL ne '') { $callBackURLParam = $callBackURL; } return $applicationSecret."|". $urlParam . $callBackURLParam . "|".$self->browserHeight()."|".$self->browserWidth()."|".$self->customId()."|".$self->customWaterMarkId(). "|".$self->start()."|".$self->requestAs()."|".$self->country()."|".$self->exportURL()."|".$self->waitForElement(). "|".$self->encryptionKey()."|".$self->noAds()."|".$self->{"post"}."|".$self->proxy()."|".$self->address()."|".$self->noCookieNotifications(). "|".$self->clickElement()."|".$self->framesPerSecond()."|".$self->duration()."|".$self->width()."|".$self->height(); } sub _getParameters($$$$$) { my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_; $params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue); $params->{'bwidth'} = $self->browserWidth(); $params->{'bheight'} = $self->browserHeight(); $params->{'duration'} = $self->duration(); $params->{'start'} = $self->start(); $params->{'fps'} = $self->framesPerSecond(); $params->{'customwatermarkid'} = $self->customWaterMarkId(); $params->{'requestmobileversion'} = $self->requestAs(); $params->{'waitfor'} = $self->waitForElement(); $params->{'noads'} = $self->noAds(); $params->{'post'} = $self->{"post"}; $params->{'nonotify'} = $self->noCookieNotifications(); $params->{'address'} = $self->address(); $params->{'click'} = $self->clickElement(); $params->{'width'} = $self->width(); $params->{'height'} = $self->height(); return $params; } 1;GrabzItClient-3.5.7/GrabzItWaterMark.pm000666 000000 000000 00000001157 13766733233 016140 0ustar00000000 000000 #!/usr/bin/perl package GrabzItWaterMark; sub new { my $class = shift; my $self = { _identifier => shift, _xPosition => shift, _yPosition => shift, _format => shift, }; bless $self, $class; return $self; } sub getIdentifier { my ($self) = @_; return $self->{_identifier}; } sub getXPosition { my ($self) = @_; return $self->{_xPosition}; } sub getYPosition { my ($self) = @_; return $self->{_yPosition}; } sub getFormat { my ($self) = @_; return $self->{_path}; } 1;GrabzItClient-3.5.7/MakeFIle.pl000666 000000 000000 00000001765 14611554430 014367 0ustar00000000 000000 #!/usr/bin/perl use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'GrabzItClient', AUTHOR => q{GrabzIt }, VERSION => '3.5.7', ABSTRACT => 'GrabzIt enables allows you to programmatically convert web pages and HTML into images, DOCX, videos, rendered HTML, PDFs, CSVs and spreadsheets. Additionally GrabzIt allows you to convert online videos into animated GIFs', ( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ( 'LICENSE' => 'perl' ) : () ), PL_FILES => {}, PREREQ_PM => { 'Digest::MD5' => 2.58, 'Encode' => 3.08, 'LWP::Simple' => 6.55, 'LWP::UserAgent' => 6.55, 'LWP::UserAgent' => 6.55, 'HTTP::Request::Common' => 6.27, 'URI::Escape' => 5.06, 'XML::Twig' => 3.52, 'File::Spec' => 3.78, 'File::Basename' => 2.85, }, TEST_REQUIRES => { 'Test::More' => 1.302183, 'Test::Exception' => 0.43, }, );GrabzItClient-3.5.7/MANIFEST000666 000000 000000 00000000757 14611554455 013555 0ustar00000000 000000 GrabzItAnimationOptions.pm GrabzItBaseOptions.pm GrabzItClient.pm GrabzItCookie.pm GrabzItDOCXOptions.pm GrabzItHTMLOptions.pm GrabzItImageOptions.pm GrabzItPDFOptions.pm GrabzItRequest.pm GrabzItTableOptions.pm GrabzItVideoOptions.pm GrabzItWaterMark.pm MakeFIle.pl MANIFEST This list of files README.md ScreenShotStatus.pm META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) GrabzItClient-3.5.7/META.json000666 000000 000000 00000003026 14611554455 014035 0ustar00000000 000000 { "abstract" : "GrabzIt enables allows you to programmatically convert web pages and HTML into images, DOCX, videos, rendered HTML, PDFs, CSVs and spreadsheets. Additionally GrabzIt allows you to convert online videos into animated GIFs", "author" : [ "GrabzIt " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.58, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "GrabzItClient", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Digest::MD5" : "2.58", "Encode" : "3.08", "File::Basename" : "2.85", "File::Spec" : "3.78", "HTTP::Request::Common" : "6.27", "LWP::Simple" : "6.55", "LWP::UserAgent" : "6.55", "URI::Escape" : "5.06", "XML::Twig" : "3.52" } }, "test" : { "requires" : { "Test::Exception" : "0.43", "Test::More" : "1.302183" } } }, "release_status" : "stable", "version" : "v3.5.7", "x_serialization_backend" : "JSON::PP version 4.06" } GrabzItClient-3.5.7/META.yml000666 000000 000000 00000001726 14611554451 013666 0ustar00000000 000000 --- abstract: 'GrabzIt enables allows you to programmatically convert web pages and HTML into images, DOCX, videos, rendered HTML, PDFs, CSVs and spreadsheets. Additionally GrabzIt allows you to convert online videos into animated GIFs' author: - 'GrabzIt ' build_requires: ExtUtils::MakeMaker: '0' Test::Exception: '0.43' Test::More: '1.302183' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.58, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: GrabzItClient no_index: directory: - t - inc requires: Digest::MD5: '2.58' Encode: '3.08' File::Basename: '2.85' File::Spec: '3.78' HTTP::Request::Common: '6.27' LWP::Simple: '6.55' LWP::UserAgent: '6.55' URI::Escape: '5.06' XML::Twig: '3.52' version: v3.5.7 x_serialization_backend: 'CPAN::Meta::YAML version 0.018' GrabzItClient-3.5.7/README.md000666 000000 000000 00000000472 14562214052 013664 0ustar00000000 000000 # GrabzIt 3.5 This library allows you to programmatically convert web pages and HTML into images, videos, DOCX, rendered HTML, PDF's, CSV's and spreadsheets. Additionally GrabzIt allows you to convert online videos into animated GIF's. More documentation can be found on [GrabzIt](https://grabz.it/api/perl/)GrabzItClient-3.5.7/ScreenShotStatus.pm000666 000000 000000 00000001102 13766733233 016227 0ustar00000000 000000 #!/usr/bin/perl package ScreenShotStatus; sub new { my $class = shift; my $self = { _processing => shift, _cached => shift, _expired => shift, _message => shift, }; bless $self, $class; return $self; } sub getProcessing { my ($self) = @_; return $self->{_processing}; } sub getCached { my ($self) = @_; return $self->{_cached}; } sub getExpired { my ($self) = @_; return $self->{_expired}; } sub getMessage { my ($self) = @_; return $self->{_message}; } 1;