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.0.2 to 0.0.4

22

index.js
"use strict";
const cheerio = require("cheerio");
const rp = require("request-promise");

@@ -36,3 +37,24 @@

});
},
moz: (url) => {
return rp.post({
url: "http://www.checkmoz.com/",
form: {
"f_urls": url
}
}).then((data) => {
const $ = cheerio.load(data);
const metricsRow = $(".rowclass1 td");
return {
da: $(metricsRow[1]).text(),
pa: $(metricsRow[2]).text(),
ranks: $(metricsRow[3]).text(),
links: $(metricsRow[4]).text()
};
});
}
};

3

package.json
{
"name": "i-promise-page-metrics",
"version": "0.0.2",
"version": "0.0.4",
"license": "MIT",
"description": "Fetches different page metrics for a given URL",
"dependencies": {
"cheerio": "^0.20.0",
"request": "^2.60.0",

@@ -8,0 +9,0 @@ "request-promise": "^4.1.1"

# 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 `Facebook` and `Google+` metrics.
For those of you who want to get page metrics for different URLs. This module will supply you with `Facebook`, `Google+` and `Moz metrics.

@@ -30,4 +30,9 @@ ## Install

```
pageMetrics.moz(url)
.then((response) => {
//=> {da: 1, pa: 22, rank: 2, links: 100}
});
````
## Running tests

@@ -34,0 +39,0 @@

@@ -28,2 +28,14 @@ "use strict";

});
it("should return moz data", (done) => {
pageMetrics.moz(url)
.then((response) => {
response.da.should.be.above(10);
response.pa.should.be.above(10);
response.ranks.should.be.above(1);
response.links.should.be.above(100);
done();
});
});
});

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