Skip to content

Commit 42688c4

Browse files
authored
Merge pull request #2384 from caternuson/stats_update
Update to use API key in Pi-Hole Python scripts
2 parents 4f5aec7 + 237d565 commit 42688c4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Pi_Hole_Ad_Blocker/mini_pitft_stats.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
from PIL import Image, ImageDraw, ImageFont
2020
import adafruit_rgb_display.st7789 as st7789
2121

22-
api_url = 'http://localhost/admin/api.php'
22+
API_TOKEN = "YOUR_API_TOKEN_HERE"
23+
api_url = "http://localhost/admin/api.php?summaryRaw&auth="+API_TOKEN
2324

2425
# Configuration for CS and DC pins (these are FeatherWing defaults on M0/M4):
2526
cs_pin = digitalio.DigitalInOut(board.CE0)

Pi_Hole_Ad_Blocker/stats.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
# Import Python Imaging Library
4646
from PIL import Image, ImageDraw, ImageFont
4747

48-
api_url = 'http://localhost/admin/api.php'
48+
API_TOKEN = "YOUR_API_TOKEN_HERE"
49+
api_url = "http://localhost/admin/api.php?summaryRaw&auth="+API_TOKEN
4950

5051
# Create the I2C interface.
5152
i2c = busio.I2C(SCL, SDA)

0 commit comments

Comments
 (0)