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

i-promise-page-metrics

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i-promise-page-metrics - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

.editorconfig

25

index.js

@@ -8,2 +8,27 @@ "use strict";

alexa: (url, proxy) => {
const cleanUrl = url.replace("http://", "").replace("https://", "");
const opts = {
uri: "https://theseotools.net/alexa-rank-checker/output",
form: {
url: cleanUrl,
submit: "Submit"
}
};
if (proxy) opts.proxy = proxy;
return rp.post(opts)
.then((data) => {
const $ = cheerio.load(data);
const table = $(".table-bordered tbody");
return {
globalRank: $($("td", $("tr", table)[1])[1]).text().trim() || 0,
popularityAt: $($("td", $("tr", table)[2])[1]).text().trim() || 0,
regionalRank: $($("td", $("tr", table)[3])[1]).text().trim() || 0,
backLinks: $($("td", $("tr", table)[4])[1]).text().trim() || 0
};
});
},
googleplus: (url, proxy) => {

@@ -10,0 +35,0 @@ const opts = {

12

package.json
{
"name": "i-promise-page-metrics",
"version": "0.1.2",
"version": "1.0.0",
"license": "MIT",

@@ -17,8 +17,12 @@ "description": "Fetches different page metrics for a given URL",

"mocha": "^2.5.3",
"mocha-cakes-2": "^1.1.1"
"mocha-cakes-2": "^1.1.1",
"nock": "^9.0.13"
},
"repository": "odynvolk/i-promise-page-metrics",
"repository": {
"type": "git",
"url": "https://github.com/odynvolk/i-promise-page-metrics.git"
},
"scripts": {
"test": "mocha && eslint ."
"test": "mocha && eslint . --cache"
}
}
# i-promise-page-metrics
> A node module for retrieving different page metrics for an URL
For those of you who want to get page metrics for different URLs. This module will supply you with `Google+` and `Moz metrics.
For those of you who want to get page metrics for different URLs. This module will supply you with `Alexa`, `Google+` and `Moz` metrics.

@@ -20,2 +20,7 @@ ## Install

pageMetrics.alexa(url)
.then((response) => {
//=> {globalRank: 1000, popularityAt: "United States", regionalRank: 200, backLinks: 5000}
});
pageMetrics.googleplus(url)

@@ -52,2 +57,1 @@ .then((response) => {

Released under the MIT license.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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