Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
goo.gl
Advanced tools
Readme
npm install -g goo.gl
$ goo.gl www.google.com
http://www.google.com -> http://goo.gl/fbsS
$ goo.gl http://goo.gl/fbsS
http://goo.gl/fbsS -> http://www.google.com/
$ goo.gl www.google.com http://goo.gl/fbsS nba.com
http://goo.gl/fbsS -> http://www.google.com/
http://www.google.com -> http://goo.gl/fbsS
http://nba.com -> http://goo.gl/d1T8
$ goo.gl --key aBcDeFGhIjKLMnOPqRsT www.spotify.com
http://www.spotify.com/ -> http://goo.gl/cJFAL
It'll shorten and/or expand one or more URLs at a time.
Most methods return promises.
var googl = require('goo.gl');
// Set a developer key (_required by Google_; see http://goo.gl/4DvFk for more info.)
googl.setKey('aBcDeFGhIjKLMnOPqRsT');
// Get currently set developer key
googl.getKey();
// Shorten a long url and output the result
googl.shorten('http://www.google.com/')
.then(function (shortUrl) {
console.log(shortUrl);
})
.catch(function (err) {
console.error(err.message);
});
// Expand a goo.gl url and output the result
googl.expand('http://goo.gl/fbsS')
.then(function (longUrl) {
console.log(longUrl);
})
.catch(function (err) {
console.error(err.message);
});
// Expand a goo.gl url and pass userIp for capping purposes
googl.expand('http://goo.gl/fbsS', { userIp: '127.0.0.1' })
.then(function (longUrl) {
console.log(longUrl);
})
.catch(function (err) {
console.error(err.message);
});
// Shorten a goo.gl url and pass quotaUser for capping purposes
// See: https://developers.google.com/console/help/#cappingusage
googl.shorten('www.spotify.com', { quotaUser: 'UserID' })
.then(function (shortUrl) {
console.log(shortUrl);
})
.catch(function (err) {
console.error(err.message);
});
// Look up a short URL's analytics
// See: https://developers.google.com/url-shortener/v1/getting_started#url_analytics
googl.analytics('http://goo.gl/fbsS', {projection: 'ANALYTICS_CLICKS'})
.then(function(result) {
console.log(result);
})
.catch(function (err) {
console.error(err.message);
});
googl.analytics('http://goo.gl/fbsS', {projection: 'FULL'})
.then(function(result) {
console.log(result);
})
.catch(function (err) {
console.error(err.message);
});
googl.analytics('http://goo.gl/fbsS', {projection: 'ANALYTICS_TOP_STRINGS'})
.then(function(result) {
console.log(result);
})
.catch(function (err) {
console.error(err.message);
});
//default to projection=FULL
googl.analytics('http://goo.gl/fbsS')
.then(function(result) {
console.log(result);
})
.catch(function (err) {
console.error(err.message);
});
FAQs
A url shortener and expander powered by Google's URL shortening service
The npm package goo.gl receives a total of 1,211 weekly downloads. As such, goo.gl popularity was classified as popular.
We found that goo.gl 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.