MCPcopy
hub / github.com/lissy93/web-check / phishTank

Function phishTank

api/threats.js:46–58  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

44};
45
46const phishTank = async (url) => {
47 try {
48 const encoded = Buffer.from(url).toString('base64');
49 const res = await httpPost(`https://checkurl.phishtank.com/checkurl/?url=${encoded}`, null, {
50 headers: { 'User-Agent': 'phishtank/web-check' },
51 timeout: 3000,
52 });
53 const parsed = await xml2js.parseStringPromise(res.data, { explicitArray: false });
54 return parsed.response.results;
55 } catch (error) {
56 return upstreamError(error, 'PhishTank');
57 }
58};
59
60const cloudmersive = async (url) => {
61 const auth = requireEnv('CLOUDMERSIVE_API_KEY', 'Cloudmersive');

Callers 1

threatsHandlerFunction · 0.85

Calls 2

httpPostFunction · 0.90
upstreamErrorFunction · 0.90

Tested by

no test coverage detected