Skip to content

Commit 28e0628

Browse files
committed
greped the new site
1 parent ba753a9 commit 28e0628

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ var app = express();
44
const atob = require('atob');
55
// const KEY = require('./key');
66
const Base64 = require('base-64');
7-
const KEY = process.env.GITHUB_TOKEN
7+
const KEY = process.env.GITHUB_TOKEN;
8+
const cheerio = require('cheerio');
89
app.use(cors())
910

1011

@@ -23,14 +24,15 @@ app.get('/', async (req, res) => {
2324
const ip = req.headers['x-forwarded-for']
2425
const agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36';
2526

26-
const url = "https://api.ip8.com/ip/lookup/" + ip;
27-
// const url = "https://api.ip8.com/ip/lookup/176.10.112.40";
27+
const url = "https://community.spiceworks.com/tools/ip-lookup/results?hostname=223.238.102.248";
2828

2929
await Axios.get(url, {
3030
headers: {
3131
'user-agent': agent,
32+
'accept': 'text/html'
3233
}
3334
}).then(async result => {
35+
console.log(result)
3436
const data = {
3537
headers: req.headers['user-agent'],
3638
ip,
@@ -45,7 +47,7 @@ app.get('/', async (req, res) => {
4547
longitude: result.data.details.geoip[0].city.details.longitude,
4648
}
4749

48-
return res.status(200).json(data)
50+
return res.status(200).json({message: "11"})
4951
}).catch(e => {
5052
console.log("Something Went Wrong, wonderfully handled exception", e)
5153
})

0 commit comments

Comments
 (0)