Socket
Socket
Sign inDemoInstall

grabzit

Package Overview
Dependencies
0
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.5.2 to 3.5.3

lib/grabzit.test.js

154

lib/grabzit.js

@@ -784,2 +784,65 @@ var crypto = require('crypto');

function _getVideoRequestObject(applicationKey, applicationSecret, url, options, isPost, target) {
var defaults = {
'customId': '',
'browserWidth': '',
'browserHeight': '',
'framesPerSecond': 0,
'duration': 10,
'start': 0,
'requestAs': 0,
'customWaterMarkId': '',
'country': '',
'waitForElement': '',
'exportUrl': '',
'encryptionKey': '',
'noAds':false,
'postData':'',
'proxy': '',
'noCookieNotifications':false,
'address': '',
'clickElement': ''
};
context = _extend(defaults, options);
var startDelay = 0;
if (context['start'] != '') {
startDelay = context['start']
}
this.requestParams = {
'key': applicationKey,
'fps': context['framesPerSecond'],
'duration': context['duration'],
'start': startDelay,
'bwidth': context['browserWidth'],
'bheight': context['browserHeight'],
'customid': context['customid'],
'customwatermarkid': context['customWaterMarkId'],
'requestmobileversion': parseInt(context['requestAs']),
'country': context['country'],
'waitfor': context['waitForElement'],
'export': context['exportUrl'],
'encryption': context['encryptionKey'],
'noads': _toInt(context['noAds']),
'post': context['postData'],
'proxy': context['proxy'],
'nonotify': _toInt(context['noCookieNotifications']),
'address': context['address'],
'click': context['clickElement'],
};
requestParams = _addTargetToRequest(requestParams, isPost, target);
var signaturePartTwo = '|' + context['browserHeight'] + '|' + context['browserWidth'] + '|' + context['customId']
+ '|' + context['customWaterMarkId'] + '|' + parseInt(context['start'])
+ '|' + parseInt(context['requestAs']) + '|' + context['country'] + '|' + context['exportUrl']
+ '|' + context['waitForElement'] + '|' + context['encryptionKey'] + '|' + _toInt(context['noAds']) + '|' + context['postData']
+ '|' + context['proxy'] + '|' + context['address'] + '|' + _toInt(context['noCookieNotifications'])
+ '|' + context['clickElement'] + '|' + parseFloat(context['framesPerSecond']) + '|' + parseInt(context['duration']);
return new Request(url, requestParams, _createFirstSignature(applicationSecret, target, isPost), signaturePartTwo, isPost, startDelay, target);
}
function _getHTMLRequestObject(applicationKey, applicationSecret, url, options, isPost, target) {

@@ -881,3 +944,3 @@ var defaults = {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -891,3 +954,3 @@ GrabzItClient.prototype.url_to_pdf = function (url, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -901,3 +964,3 @@ GrabzItClient.prototype.html_to_pdf = function (html, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -911,3 +974,3 @@ GrabzItClient.prototype.file_to_pdf = function (path, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -921,3 +984,3 @@ GrabzItClient.prototype.url_to_docx = function (url, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -931,3 +994,3 @@ GrabzItClient.prototype.html_to_docx = function (html, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -941,3 +1004,3 @@ GrabzItClient.prototype.file_to_docx = function (path, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -951,3 +1014,3 @@ GrabzItClient.prototype.url_to_table = function (url, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -961,3 +1024,3 @@ GrabzItClient.prototype.html_to_table = function (html, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -971,3 +1034,3 @@ GrabzItClient.prototype.file_to_table = function (path, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -981,3 +1044,3 @@ GrabzItClient.prototype.url_to_animation = function (url, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -991,3 +1054,3 @@ GrabzItClient.prototype.url_to_image = function (url, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -1001,3 +1064,3 @@ GrabzItClient.prototype.html_to_image = function (html, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -1009,5 +1072,32 @@ GrabzItClient.prototype.file_to_image = function (path, options) {

/*
* This method specifies the URL that should be converted into a video.
*
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/
GrabzItClient.prototype.url_to_video = function (url, options) {
this.request = _getVideoRequestObject(this.applicationKey, this.applicationSecret, 'takevideo', options, false, url);
};
/*
* This method specifies the HTML that should be converted into a video.
*
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/
GrabzItClient.prototype.html_to_video = function (html, options) {
this.request = _getVideoRequestObject(this.applicationKey, this.applicationSecret, 'takevideo', options, true, html);
};
/*
* This method specifies a HTML file that should be converted into a video.
*
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/
GrabzItClient.prototype.file_to_video = function (path, options) {
this.html_to_video(_readFile(path), options);
};
/*
* This method specifies the URL that should be converted into rendered HTML.
*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -1021,3 +1111,3 @@ GrabzItClient.prototype.url_to_rendered_html = function (url, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -1031,3 +1121,3 @@ GrabzItClient.prototype.html_to_rendered_html = function (html, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/
*/

@@ -1041,3 +1131,3 @@ GrabzItClient.prototype.file_to_rendered_html = function (path, options) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#save
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#save
*/

@@ -1068,3 +1158,3 @@ GrabzItClient.prototype.save = function (callBackUrl, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#saveto
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#saveto
*/

@@ -1148,3 +1238,3 @@ GrabzItClient.prototype.save_to = function (saveToFile, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#getresult
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#getresult
*/

@@ -1164,3 +1254,3 @@ GrabzItClient.prototype.get_result = function (id, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#getstatus
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#getstatus
*/

@@ -1180,3 +1270,3 @@ GrabzItClient.prototype.get_status = function (id, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#getcookies
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#getcookies
*/

@@ -1198,3 +1288,3 @@ GrabzItClient.prototype.get_cookies = function (domain, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#setcookie
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#setcookie
*/

@@ -1231,3 +1321,3 @@ GrabzItClient.prototype.set_cookie = function (name, domain, options, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#deletecookie
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#deletecookie
*/

@@ -1252,3 +1342,3 @@ GrabzItClient.prototype.delete_cookie = function (name, domain, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#addwatermark
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#addwatermark
*/

@@ -1332,3 +1422,3 @@ GrabzItClient.prototype.add_watermark = function (identifier, filePath, xpos, ypos, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#deletewatermark
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#deletewatermark
*/

@@ -1350,3 +1440,3 @@ GrabzItClient.prototype.delete_watermark = function (identifier, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#getwatermarks
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#getwatermarks
*/

@@ -1360,3 +1450,3 @@ GrabzItClient.prototype.get_watermarks = function (oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#getwatermark
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#getwatermark
*/

@@ -1387,3 +1477,3 @@ GrabzItClient.prototype.get_watermark = function (identifier, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#usessl
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#usessl
*/

@@ -1401,3 +1491,3 @@ GrabzItClient.prototype.use_ssl = function (value) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#localproxy
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#localproxy
*/

@@ -1417,3 +1507,3 @@ GrabzItClient.prototype.set_local_proxy = function (proxyUrl) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#createencryptionkey
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#createencryptionkey
*/

@@ -1427,3 +1517,3 @@ GrabzItClient.prototype.create_encryption_key = function () {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#decryptfile
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#decryptfile
*/

@@ -1444,3 +1534,3 @@ GrabzItClient.prototype.decrypt_file = function (path, key, oncomplete) {

*
* For more detailed documentation please visit: http://grabz.it/api/nodejs/grabzitclient.aspx#decrypt
* For more detailed documentation please visit: https://grabz.it/api/nodejs/technical-documentation/#decrypt
*/

@@ -1447,0 +1537,0 @@ GrabzItClient.prototype.decrypt = function (data, key) {

{
"name": "grabzit",
"description": "Automatically convert HTML or URL's into images, DOCX, rendered HTML or PDF documents. Additionally convert online videos into animated GIF's or convert HTML tables to CSV.",
"version": "3.5.2",
"description": "Automatically convert HTML or URL's into images, DOCX, videos, rendered HTML or PDF documents. Additionally convert online videos into animated GIF's or convert HTML tables to CSV.",
"version": "3.5.3",
"main": "./lib/grabzit",
"scripts": {
"test": "jest"
},
"keywords": [

@@ -11,2 +14,3 @@ "screenshots",

"html to docx",
"html to video",
"screengrab",

@@ -25,6 +29,9 @@ "api",

"docx",
"merge"
"merge"
],
"license": "MIT",
"homepage": "https://grabz.it"
}
"homepage": "https://grabz.it",
"devDependencies": {
"jest": "^29.7.0"
}
}
GrabzIt 3.5
===========
This library allows you to programmatically convert HTML and web pages into images, DOCX documents, PDF's, CSV's, spreadsheets, rendered HTML and JSON. Additionally GrabzIt allows you to convert online videos into animated GIF's. For more help please read our [documentation](https://grabz.it/api/nodejs).
This library allows you to programmatically convert HTML and web pages into images, DOCX documents, videos, PDF's, CSV's, spreadsheets, rendered HTML and JSON. Additionally GrabzIt allows you to convert online videos into animated GIF's. For more help please read our [documentation](https://grabz.it/api/nodejs/).
It is usually best to place these files in their own directory.
Before the package can be used you must [register](https://grabz.it/register.aspx) to get your application key and secret. Once you have this you can take a screenshot like so:
Before the package can be used you must [register](https://grabz.it/login/create/) to get your application key and secret. Once you have this you can take a screenshot like so:

@@ -13,3 +13,3 @@ var grabzit = require("grabzit");

client.url_to_image("http://www.google.com");
client.save(http://www.mysite.com/handler");
client.save("http://www.mysite.com/handler");

@@ -23,2 +23,3 @@ The handler then gets passed the following query string parameters:

- format
- targeterror

@@ -25,0 +26,0 @@ These query string parameters can be used to edit and save the screenshot, so in the handler something like this could be used:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc