Skip to content

Commit

Permalink
Update to be deployed as a nom package
Browse files Browse the repository at this point in the history
  • Loading branch information
maxenceC committed Jul 9, 2018
1 parent a437b1f commit 7b250ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
5 changes: 0 additions & 5 deletions index.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "detect-bat-publishers",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "./src/lib.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node --max_old_space_size=4096 index.js"
"start": "node --max_old_space_size=4096 ./src/lib.js"
},
"author": "",
"license": "ISC",
Expand Down
12 changes: 6 additions & 6 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var _ = require('underscore');
const dns = require('dns');
var rp = require('request-promise');

let is_website_verified_by_dns_record = (website_url) => {
let isWebsiteVerifiedByDnsRecord = (website_url) => {
return new Promise((resolve, reject) => {
return dns.resolve(website, 'TXT', function (err, records) {
if (err) {
Expand All @@ -20,7 +20,7 @@ let is_website_verified_by_dns_record = (website_url) => {
})
}

let is_website_verified_by_txt_verification_file = (website_url) => {
let isWebsiteVerifiedByTxtVerificationFile = (website_url) => {
return rp(website_url + '/.well-known/brave-payments-verification.txt')
.then(function (res) {
res = JSON.parse(res);
Expand All @@ -35,7 +35,7 @@ let is_website_verified_by_txt_verification_file = (website_url) => {
});
}

let is_website_verified_by_brave_api_call = (website_url) => {
let isWebsiteVerifiedByBraveApiCall = (website_url) => {
return rp('https://mercury-proxy.privateinternetaccess.com/v3/publisher/identity?publisher=' + website_url)
.then(function (res) {
res = JSON.parse(res);
Expand All @@ -49,9 +49,9 @@ let is_website_verified_by_brave_api_call = (website_url) => {
}

const check = {
is_website_verified_by_dns_record,
is_website_verified_by_txt_verification_file,
is_website_verified_by_brave_api_call,
isWebsiteVerifiedByDnsRecord,
isWebsiteVerifiedByTxtVerificationFile,
isWebsiteVerifiedByBraveApiCall,
}

module.exports = check;

0 comments on commit 7b250ab

Please sign in to comment.