i-promise-page-metrics
Advanced tools
Comparing version 0.1.2 to 1.0.0
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 = { |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
47915
17
139
1
56
7