pi-hole / FTL

The Pi-hole FTL engine
https://pi-hole.net
Other
1.38k stars 196 forks source link

api string format? #131

Closed C4Wiz closed 7 years ago

C4Wiz commented 7 years ago

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

How familiar are you with the codebase?:

5


i just have a few questions on the new format:

i am trying to expand the bitbar plugin to use the new api calls, i have integrated the enable and disable.

1: i would like the status to be displayed in the bitbar but can't figure out the call

2: is there a way to combine the enable and disable commands to 1 line based on a true/false IE: if status disabled true enable or disabled fasle disable

below is my current code, status: is the place holder. hashed password removed for security:

import urllib2 import json

If you have UTF-8 problems then uncomment next 3 lines

import sys

reload(sys)

sys.setdefaultencoding("utf-8")

Change to Your Pi-Hole Admin Console Url

pihole = "http://pi-hole.local/admin/"

Change to Your Pi-Hole Admin Console Hashed Password (see WEBPASSWORD in /etc/pihole/setupVars.conf)

passwd = "hashed password here"

try: url = pihole + "api.php?summary" result = urllib2.urlopen(url, timeout = 15).read() json = json.loads(result) print "| image=iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2Y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////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAIXqAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP+oAAD/DwAAegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqAACB5QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/+wAAP+jAAD/MgAAcQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAf90AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/4AAA/7gAAP/cAAD/JgAAbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAHjdAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP/oAAD/kgAA/+wAAP/bAAD/JAAAawAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAA2AAB14QAA//8AAP/6AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/90AAP+UAAD/9gAA//8AAP/TAAD/HwAAXgAAAAADAAAAAQAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAAAAAAAAAAADgAAbp8AAP/HAAD/mQAA/5cAAP++AAD/+QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/lgAA/5UAAP//AAD//wAA//8AAP/LAAD+IgAAVSAAAAAUAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAAAgAAGyiAAD/6AAA/9UAAP/ZAAD/xQAA/3sAAP9PAAD/wwAA//8AAP//AAD//wAA//8AAP//AAD//wAA/8YAAP8/AAD/2wAA//8AAP//AAD//wAA//8AAP+9AAD6HwAATwkAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAYAABcxQAA//8AAP//AAD//wAA//8AAP//AAD//wAA/44AAP8KAAD/dAAA/9sAAP//AAD//wAA//8AAP/AAAD/FQAA/5QAAP//AAD//wAA//8AAP//AAD//wAA//8AAP+oAADxBwAAPAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAG54AAOL/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/4YAAP8AAAD/EAAA/0IAAP9hAAD/QwAA/wAAAP9eAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP94AADKAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAACwuAACI7AAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/5QAA/yAAAP8AAAD/AAAA/wAAAP8AAAD/BQAA/9cAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/9sAAP0NAABVAAAAC////wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AGQAAiG0AAOX/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP/9AAD/UAAA/wAAAP8AAAD/AAAA/wAAAP9IAAD/+QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/+gAA/0oAAM0DAABu////AP///wD///8A////AP///wACAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAALCAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwAAAD4AAAAAAAAAAAAAAAAAAAAAAAAAB0AAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAEwAAIQcAACcAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAOAAALXPAAC++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5wAAAM4AAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPUAAADiAADI9gAAwwAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAAAAAAIAADvSAADz/wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP+YAAD/AAAA/wgAAP8VAAD/CAAA/wAAAP8MAAD/2wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/0gAA8wEAADsAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAEkAAKH8AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/1gAA/w8AAP9ZAAD/vQAA/9oAAP++AAD/gAAA/xAAAP87AAD/9AAA//8AAP//AAD//wAA//8AAP//AAD//wAA//wAAP9IAACeAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAEnMAAL//AAD//wAA//8AAP//AAD//wAA//8AAP9JAAD/eAAA//8AAP//AAD//wAA//8AAP//AAD/5QAA/2AAAP9eAAD/1AAA//8AAP//AAD//wAA//8AAP/sAAD/VQAAugAAAA4AAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAAAAAAAAAAE3UAAMb/AAD//wAA//8AAP//AAD/oAAA/1kAAP/2AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/78AAP+IAAD/mgAA/64AAP/GAAD/zAAA/zgAAMIAAAAPAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAYAAAANAAAAAAAAF3cAAM//AAD//wAA//8AAP9/AAD/xwAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//gAAP/SAAD/xAAA//AAAP9kAADLAAAAFQAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAABAAAABUAAAAVAAAAAAAAHHIAAMr/AAD/4AAA/44AAP/rAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/gAAAygkAABsJAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAEAAAAFAAAABYAAAATAAAAAAAAHIAAAMLzAAD/mAAA/+oAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/3cAAMYAAAAeHgAAAAkAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAQAAAAUAAAAFgAAABUAAAAMAAAAAQAAFHMAAMfFAAD/9QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP9+AADNAAAAGREAAAAgAAAACQAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAABAAAABQAAAAWAAAAFAAAABQAAAANAAAADQAAF0QAAM/oAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/hwAA2wMAAB0SAAAAGgAAACAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAEAAAAFAAAABYAAAAUAAAAEgAAABUAAAAiAAAAAAAAHV4AAMv/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/4cAANsMAAAnHgAAABkAAAAYAAAAIAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAQAAAAUAAAAFgAAABQAAAASAAAAFQAAACQAAAAKAAAAAAAAHGsAALz2AAD//wAA//8AAP//AAD//wAA//IAAP9tAAC/DAAAJyQAAAAfAAAAGQAAABgAAAAgAAAACQAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAH///8AAAAAAAAAAAAAAAAAAAAAAAEBAQAAAAAABAAAABAAAAACAAAA/gAAAP4AAAADAAAADwAAAOcAAAD+AAAA9wAABioAAGtgAABeOQAAHPsAAP/BAADepQAAoNwAAJ4jAAD6AwAAAPkAAAD6AAAA/wAAAAgAAADpAAAA9wAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAQAA//8wabirP4J+hgAAAABJRU5ErkJggg==" print "---" print "Status:" print "---" print "Open the Pi-Hole GUI" + "| color=red href=" + pihole print "---" print "Enable Pi-Hole | color=green href=" + pihole + "api.php?enable&auth=" + passwd print "---" print "Disable Pi-Hole | color=red href=" + pihole + "api.php?disable&auth=" + passwd print "---" print "Domains Being Blocked: | color=navy" print str(json['domains_being_blocked']) + "| color=black" print "Unique Domains Today: | color=navy" print str(json['unique_domains']) + "| color=black" print "Ads Blocked Today: | color=navy" print str(json['ads_blocked_today']) + " or", str(json['ads_percentage_today']) + "%| color=black" print "DNS Queries Today: | color=navy" print str(json['dns_queries_today']) + "| color=black" print "Queries Forwarded Today: | color=navy" print str(json['queries_forwarded']) + "| color=black" print "Queries Cached Today: | color=navy" print str(json['queries_cached']) + "| color=black" print "---"

except Exception as e: print e print "❌" print "---" print "Pi-Hole not found | color=red" print "---"

-

-

Log file output [if available]

output

Device specifics

Hardware Type: rPi, VPS, etc OS:

This template was created based on the work of udemy-dl.

DL6ER commented 7 years ago

Issue moved to pi-hole/AdminLTE #575 via ZenHub

DL6ER commented 7 years ago

Moved this to the web repository since you are using the api.php interface and not a direct connection to FTL.