Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
geoscreenshot-api-example
Advanced tools
Example for consuming basic operations of the GeoScreenshot web capture API. The example makes calls to the capture web service to retrieve capture data and stores the image as a PNG file. The simple use case captures Yahoo Weather for all available plus
This is an example for the early release GS API Alpha. It captures Yahoo Weather Pages from several locations.
This simple script calls the GS API and generates PNG files.
For a given URL, it will simultaneously request screenshots for 1 or more locations and outputs PNGs and JSON Metadata in the specified directory.
The documentation for the web service can be found here: https://www.geoscreenshot.com/docs/
"use strict";
const config = {
'url': 'http://news.google.com',
'imageDir': './out/',
'verbose': true
};
const gs = require('./geoscreenshot')(config);
gs.locations()
.then(gs.filter('IN')) // Filter by country code
.then(gs.multicapture)
.then((results) => {
console.log("Captured ", results.length, "locations");
}, (error) => {
// Handle error
});
In your .js
file:
// Set default URL, defaults to Yahoo Weather and current dir respectively
const config = {
'url': 'http://www.example.com',
'imageDir': './out/'
};
const gs = require('./geoscreenshot')(config);
gs.gsCapture('http://www.example.com').then((result) => {
console.log("Retrieved base 64 image of length: ", result.image.length);
}, (error) => {
// Handle error
});
In your .js
file:
"use strict";
const config = {
'url': 'http://weather.yahoo.com',
'imageDir': './out/',
'verbose': true
};
const gs = require('./geoscreenshot')(config);
gs.locations().then(gs.multicapture)
.then((results) => {
console.log("Captured ", results.length, "locations");
}, (error) => {
// Handle error
});
node geoscreenshot
or
node geoscreenshot single <url>
node geoscreenshot random <url>
node geoscreenshot multi <url>
The script will generate 2 files per capture
<id>.json
, example:
{
"date": 1474044949580,
"id": "ws_0a986wrvn29_1474044949443",
"location": {
"name": "lv-rix-riga",
"city": "Riga",
"state": "RIX",
"country_code": "LV",
"country": "Latvia",
"lat": 56.95,
"lon": 24.1,
"plan": "plus",
"timezone": "Europe/Riga"
},
"request": {
"url": "http://www.example.com",
"viewport": "1336x1400",
"delay": "5",
"location": "lv-rix-riga",
"useragent": "chrome",
"fullpage": 0,
"no_images": 0,
"no_cache": 0
},
"size": 46284
}
and <id>.png
Note: As of 9/15/2016, GeoScreenshot API is still in beta, API access is disabled by default. To request access, send an email to contact@geoscreenshot.com with your use case and we will upgrade your account to have this feature
git clone https://github.com/geoscreenshot/geoscreenshot-api-example.git
npm install
Use a strong alphanumeric password generator for added security DO NOT store credentials in source code DO NOT re-use credentials you use for other accounts
export GS_API_BASE="" // Optional, custom for advanced users
export GS_USERNAME="<YOURUSERNAME>" // Username used on WebUI
export GS_PASSWORD="<ALPHANUMERICPASSWORD>" // Password used on WebUI
Check if it works
node geoscreenshot.js
The RESTful API is documented here: https://www.geoscreenshot.com/docs/
If you have a problem with this sample, please file an issue here. If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request.
Any issues related to API / Web Service, please send an email to contact@geoscreenshot.com. We are still in beta and appreciate all feedback.
Copyright 2016 TE Web Solutions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Example for consuming basic operations of the GeoScreenshot web capture API. The example makes calls to the capture web service to retrieve capture data and stores the image as a PNG file. The simple use case captures Yahoo Weather for all available plus
The npm package geoscreenshot-api-example receives a total of 0 weekly downloads. As such, geoscreenshot-api-example popularity was classified as not popular.
We found that geoscreenshot-api-example demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.