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.
Small wrapper around Google Url Shortener API providing 'insert' and 'get' methods.
Small wrapper around Google Url Shortener API providing 'insert' and 'get' methods.
const gapiUrl = require('gapi-url')
const API_KEY = '<your api key here>'
// Shorten a URL
shortenURL(API_KEY, 'https://github.com', print)
function printShortened(err, res) {
if (err) return console.error(err)
console.log('shortened url: ', res)
// => shortened url: https://goo.gl/un5E
}
// Expand a shortened URL
expandURL(API_KEY, 'https://goo.gl/un5E', 'FULL', print)
function print(err, res) {
if (err) return console.error(err)
console.log('expanded url: ', res)
// => expanded url: https://github.com
}
npm install gapi-url
Table of Contents generated with DocToc
Shortens the provided url
Parameters
apiKey
String api key of your google applicationlink
String that you want to shortencb
Function with following signature function (err, shortenedLink)
Expands the provided shortened url
Parameters
apiKey
String api key of your google applicationshortened
String link that you want to expandprojection
String to include more info ANALYTICS_CLICKS| ANALYTICS_TOP_STRINGS | FULL
cb
Function with following signature function (err, expanedLink)
shortLink
Returns the url for the google analytics page for the given shortened url.
getAnalyticsURL('https://goo.gl/un5E')
=> https://goo.gl/#analytics/goo.gl/un5E/all_time
Parameters
url
String shortened URL, i.e. obtained via shortenURLReturns String link to the Google Analytics page.
https://developers.google.com/url-shortener/v1/url
https://developers.google.com/url-shortener/v1/getting_started
https://console.developers.google.com/apis/api/urlshortener.googleapis.com/overview?project=gapi-url-1513446857763&duration=PT1H
curl https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyA2LZbzpowavq0euPXmNhrSW6Q-R4-HnZA \
-H 'Content-Type: application/json' \
-d '{"longUrl": "http://www.google.com/" }'
Thanks to @anvaka for his initial shortener implementation.
MIT
FAQs
Small wrapper around Google Url Shortener API providing 'insert' and 'get' methods.
The npm package gapi-url receives a total of 2 weekly downloads. As such, gapi-url popularity was classified as not popular.
We found that gapi-url 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.