-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (31 loc) · 1.28 KB
/
index.js
File metadata and controls
32 lines (31 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const axios = require('axios');
const cheerio = require('cheerio');
axios.get(process.argv[2])
.then(function (response) {
// handle success
//console.log(response.data);
const $ = cheerio.load(response.data);
const title = $('meta[property="og:title"]').attr('content') || $('title').text() || $('meta[name="title"]').attr('content')
const description = $('meta[property="og:description"]').attr('content') || $('meta[name="description"]').attr('content')
const url = $('meta[property="og:url"]').attr('content')
const site_name = $('meta[property="og:site_name"]').attr('content')
const image = $('meta[property="og:image"]').attr('content') || $('meta[property="og:image:url"]').attr('content')
const icon = $('link[rel="icon"]').attr('href') || $('link[rel="shortcut icon"]').attr('href')
const keywords = $('meta[property="og:keywords"]').attr('content') || $('meta[name="keywords"]').attr('content')
console.log(`
Title : ${title} \n
Desc : ${description} \n
URL : ${url} \n
SiteName : ${site_name} \n
Image : ${image} \n
ICON : ${icon} \n
$keywords : ${keywords} \n
Successfuly Creeped in : ${process.argv[2]}
`);
// do something with the variables
})
.catch(function (error) {
// handle error
console.log("Could not Creep");
console.log(error);
});