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

gmailnator

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmailnator - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

150

index.js

@@ -1,2 +0,2 @@

const needle = require('needle');
const got = require("got");
const cheerio = require('cheerio');

@@ -6,11 +6,44 @@ const url = require('url');

exports.generateEmail = (cb) =>{
var data = "action=GenerateEmail&data=[]=2&data[]=1&data[]=3";
needle.post("https://gmailnator.com/index/indexquery",data,function(err,resp,body){
if (!err) {
var err = null;
cb(err,body);
} else {
var body = null;
cb(err,body)
got("https://gmailnator.com/", {
headers: {
"Host": "gmailnator.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
"DNT": "1",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1"
}
}).then(function(response) {
var $ = cheerio.load(response.body);
var csrf = $("#csrf-token")[0].attribs.content;
var bodyD = "csrf_gmailnator_token=" + csrf + "&action=GenerateEmail&data%5B%5D=2&data%5B%5D=3";
var l1 = encodeURIComponent(bodyD).match(/%[89ABab]/g);
var l = bodyD.length + (l1 ? l1.length : 0)
got.post("https://gmailnator.com/index/indexquery", {
body: bodyD,
headers: {
"Host": "gmailnator.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Content-Length": l,
"Origin": "https://gmailnator.com/",
"DNT": "1",
"Connection": "keep-alive",
"Referer": "https://gmailnator.com",
"Cookie": "csrf_gmailnator_cookie=" + csrf,
"TE": "Trailers"
}
}).then(function(response) {
cb(null, response.body)
}).catch(function(e) {
cb(e, null)
})
}).catch(function(e) {
cb(e, null)
})

@@ -29,7 +62,40 @@ }

}
var data = "action=LoadMailList&Email_address=" + encodeURIComponent(email);
needle.post("https://gmailnator.com/mailbox/mailboxquery",data,function(err,resp,body) {
if (!err) {
var err = null;
var d = JSON.parse(body);
var iburl = "https://gmailnator.com/inbox/#" + email
got(iburl, {
headers: {
"Host": "gmailnator.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
"DNT": "1",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1"
}
}).then(function(response) {
var $ = cheerio.load(response.body);
var csrf = $("#csrf-token")[0].attribs.content;
var data = "csrf_gmailnator_token=" + csrf + "&action=LoadMailList&Email_address=" + encodeURIComponent(email);
var l1 = encodeURIComponent(data).match(/%[89ABab]/g);
var l = data.length + (l1 ? l1.length : 0)
got.post("https://gmailnator.com/mailbox/mailboxquery", {
body: data,
headers: {
"Host": "gmailnator.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Content-Length": l,
"Origin": "https://gmailnator.com/",
"DNT": "1",
"Connection": "keep-alive",
"Referer": "https://gmailnator.com/inbox/",
"Cookie": "csrf_gmailnator_cookie=" + csrf,
"TE": "Trailers"
}
}).then(function(response){
var d = JSON.parse(response.body);
var b = [];

@@ -50,14 +116,18 @@ for (var c in d) {

}
var body = JSON.parse(JSON.stringify(b));
cb(err,body);
} else {
var body = null;
cb(err,body)
}
var body = JSON.parse(JSON.stringify({
"emails": b,
"csrf": csrf
}));
cb(null,body);
}).catch(function(e) {
cb(e, null)
})
}).catch(function(e) {
cb(e, null)
})
}
exports.getMessage = (str, cb) => {
if (!str) {
console.error("Needs email param");
exports.getMessage = (str, csrf, cb) => {
if (!str | !csrf) {
cb("Needs email or csrf_token param", null);
return false;

@@ -68,13 +138,29 @@ }

var id = s.hash.substring(1, s.hash.length);
var data = "action=get_message&message_id=" + id + "&email=" + email;
needle.post("https://gmailnator.com/mailbox/get_single_message/", data, function(err,resp,body) {
if (err) {
var body = null;
cb(err, body);
} else {
var body = body.split("<hr />")[1];
var err = null;
cb(err, body);
var data = "csrf_gmailnator_token=" + csrf +"&action=get_message&message_id=" + id + "&email=" + email;
var l1 = encodeURIComponent(data).match(/%[89ABab]/g);
var l = data.length + (l1 ? l1.length : 0)
got.post("https://gmailnator.com/mailbox/get_single_message/", {
body: data,
headers: {
"Host": "gmailnator.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Content-Length": l,
"Origin": "https://gmailnator.com/",
"DNT": "1",
"Connection": "keep-alive",
"Referer": "https://gmailnator.com/inbox/",
"Cookie": "csrf_gmailnator_cookie=" + csrf,
"TE": "Trailers"
}
}).then(function(response) {
var body = response.body.split("<hr />")[1];
cb(null, body)
}).catch(function(e) {
cb(e, null)
})
}
{
"name": "gmailnator",
"version": "1.0.5",
"version": "1.1.0",
"description": "access gmailnator.com programically",

@@ -19,3 +19,3 @@ "main": "index.js",

"author": "n0rmancodes",
"license": "ISC",
"license": "UNLICENSED",
"bugs": {

@@ -27,3 +27,3 @@ "url": "https://github.com/n0rmancodes/gmailnator-api/issues"

"cheerio": "^1.0.0-rc.3",
"needle": "^2.5.0"
"got": "^11.7.0"
},

@@ -30,0 +30,0 @@ "devDependencies": {},

const gmailnator = require("../../index.js");
gmailnator.checkEmails("jcnetmp+iw1dp@gmail.com", function(err,body) {
console.log(body)
gmailnator.getMessage(body[0].link, function(err,body) {
console.log(body);
})
console.log(body.emails.length + " mail");
if (body.emails[0]) {
console.log("- getting most recent email...");
gmailnator.getMessage(body.emails[0].link, body.csrf, function (err, body) {
if (err) {
console.log(err);
} else {
console.log(body)
}
})
} else {
console.log("- there is no mail to retrieve!")
}
})
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