Last active
August 31, 2018 06:40
-
-
Save arjunkomath/8c058b02ccc70f5482f2a5862c2ea595 to your computer and use it in GitHub Desktop.
Capture JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include https://github.com/blueimp/JavaScript-MD5 | |
var API_URL = 'https://api.capture.techulus.in/'; | |
var your_api_key = 'API_KEY_FROM_CONSOLE'; | |
var your_api_secret = 'API_SECRET_FROM_CONSOLE' | |
// Target URL | |
var input_url = encodeURIComponent('http://techulus.in/'); | |
var hash = md5(your_api_secret + 'url=' + input_url); | |
// Image URL | |
var result_img_url = API_URL + your_api_key + '/' + hash + '/image?url=' + input_url; | |
// PDF URL | |
var result_pdf_url = API_URL + your_api_key + '/' + hash + '/pdf?url=' + input_url; | |
console.log(result_img_url, result_pdf_url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The documentation and the url builder suggest using the https://cdn.capture.techulus.in/ endpoint, while the code sample uses the https://api.capture.techulus.in/ endpoint.
What's the difference between using
cdn
vsapi
endpoints?