added dataset

This commit is contained in:
heyethereum
2024-08-05 07:42:48 +08:00
parent e111409ef3
commit 5b88a4ca7c
3 changed files with 651228 additions and 1 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.DS_Store .DS_Store
*.env *.env
venv

27
dataset/load_data.py Normal file
View File

@@ -0,0 +1,27 @@
import csv
import requests
# Define the endpoint URL
endpoint_url = "http://localhost:8080/v1/qrcodetypes/scan"
# Path to the CSV file
csv_file_path = "malicious_phish.csv"
# Function to ensure URL starts with http:// or https://
def ensure_url_prefix(url):
if not (url.startswith("http://") or url.startswith("https://")):
return "https://" + url
return url
# Read the CSV file, prefix URLs, and send POST requests
with open(csv_file_path, newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
url = row['url']
url_with_prefix = ensure_url_prefix(url)
response = requests.post(endpoint_url, json={"data": url_with_prefix})
if response.status_code == 200:
print(f"Successfully sent data: {url_with_prefix}")
else:
print(f"Failed to send data: {url_with_prefix}, Status code: {response.status_code}")

651199
dataset/malicious_phish.csv Normal file

File diff suppressed because it is too large Load Diff