Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47717c1

Browse files
個人情報を削除
1 parent 1d38b45 commit 47717c1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,4 @@ dmypy.json
129129
.pyre/
130130

131131
/.idea
132+
.vscode/settings.json

sendIP.py

100644100755
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/usr/bin/env python3
22
# Copyright (c) 2022. 楊鵬. All Rights Reserved.
3+
import os
34
import socket
45

56
import requests
7+
from dotenv import load_dotenv
68

9+
load_dotenv()
710
URL = "https://notify-api.line.me/api/notify"
8-
TOKEN = "mCfw9Yzf8MsXuW2caAPYOkNl7nSewwYppdmV97VRWn6"
911

1012

1113
def sendIP(ip: str):
12-
headers = {"Authorization": "Bearer " + TOKEN}
14+
headers = {"Authorization": "Bearer " + os.environ["TOKEN"]}
1315
params = {"message": ip}
1416
r = requests.post(URL, headers=headers, params=params)
1517
print(r.text)

0 commit comments

Comments
 (0)