Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

urlkit

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlkit

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

UrlKit

Perfect Screenshots Anywhere

Get high quality screenshots using a real browser in seconds using our reliable CDN backed service

Requirements

Works with Ruby 1.x 2.x and Jruby

Installation

Install via gem

gem install urlkit

Once installed you can generate screenshots as follows:

from urlkit import UrlKit

urlkit = UrlKit.new('URLKIT_KEY', 'URLKIT_SECRET')

screenshotUrl = urlkit.screenshotUrl({
	"url": "bbc.com/news",
	"width": 800
})

Parameters

These are the options you can use to customize your screenshot.

ParameterDefaultDescription
urlRequired. The website address that you want to take a screenshot of.
width1920Width of the thumbnail.
viewport_width1920Width of the browser viewport this is the actual width of the page before we resize it for the thumbnail.
viewport_height(1200)Height of the browser viewport, if you do not give this parameter we will calculate it for you based on viewport_width in 16:10 ratio.
full_pagefalseCapture a full length screenshot of the requested page.
delay250Amount of time to wait before taking a screenshot of the page after it is fully loaded. Maximum 120000ms (2 minutes), minimum 250ms.
cache_time2592000Amount of time in milliseconds to wait before taking the screenshot again. Maximum 2592000ms (30 days), minimum 1ms.
user_agentLatest Firefox User AgentSet the user agent this screenshot will identify as. Useful for identifying as a mobile or tablet browser or to identify as a specific browser if the website pretends it needs Internet Explorer to view it's contents.
languagefalseTrim the outer color of the screenshot, useful for SVG's.
transparentfalseRemove the background from the page, PNG format required.
languageenAccept-Language header customization for websites that support it, set ja for Japanese, de for German etc.
cookieSemi colon separated list of cookies e.g. fruit=apple; drink=tea
disable_javascriptfalseDon't execute javascript on this page.
disable_imagesfalseDon't download images on this page.
timeout300000Amount of time in milliseconds to wait before taking screenshot anyway. Maximum 300000ms (5 minutes).
mobilefalseShortcut to set pixel_ratio, user_agent, viewport_width, viewport_height and width to that of the latest iPhone.
pixel_ratio1Multiplier that sets the pixel density of the page relative to the resolution, useful for taking retina screenshots (2).
formatpngOutput the screenshot as a PNG (png) or JPEG (jpg) image.
quality92 (if format=jpg)Set the jpeg quality of the screenshot if jpeg is set as the format.
click_selectorAccepts valid DOM selector (#wantedselector). Rendered screenshot will only display contents of DOM selector.
wait_selectorAccepts valid DOM selector (.valid_selector > .another_class). We will not take the screenshot until .valid_selector appears on this screen and is not display:none; or timeout is reached.
clip_selectorAccepts valid DOM selector (.valid_selector:not(div)). Rendered screenshot will only display contents of DOM selector.

More documentation about this package and other language implementations can be found at https://urlk.it/documentation.

Support

Contact us at support@brushd.com if you have any issues or questions about this package.

Other implementations

Need an implementation for another language?

LanguageAddress
C#https://github.com/UrlKit/urlkit-cs
Javahttps://github.com/UrlKit/urlkit-java
Node.jshttps://github.com/UrlKit/urlkit-node
PHPhttps://github.com/UrlKit/urlkit-php
Pythonhttps://github.com/UrlKit/urlkit-python
Rubyhttps://github.com/UrlKit/urlkit-ruby
Shell Scripthttps://github.com/UrlKit/urlkit-sh

FAQs

Package last updated on 01 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc