Update twittertweeter-ads.py

added option for a whole number format output, use %i
This commit is contained in:
DarthKeizer 2017-05-13 17:05:24 +02:00 committed by GitHub
parent a9155b53c9
commit 306c4ff204
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ data = urlopen('path/to/admin/api.php').read() #bytes
body = data.decode('utf-8')
data = json.loads(body)
# Create tweet, adjust %.2f for amount of decimals you want
# Create tweet, adjust %.2f for amount of decimals you want or %i for a whole number
template_tweet = "\nAds Blocked: %s\nAds Percentage Today: %.2f\nDNS Queries Today: %s\nDomains Being Blocked: %s"
data = template_tweet % (data['ads_blocked_today'],
float (data['ads_percentage_today']),