Trying to fixtweet loop error :/

This commit is contained in:
Navan Chauhan 2019-05-29 21:39:23 +05:30
parent 5448c0a18d
commit 4e4d7d9bb4
1 changed files with 8 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Modular Road-Safety Toolkit
"""
#pylint: disable=C0103,C0111
import argparse
import datetime
import time
import overpy
import simplejson as sjson
@ -99,9 +100,13 @@ def tweetMe():
url = 'https://developers.zomato.com/api/v2.1/geocode'
response = requests.get(url, headers=headers, params=params)
loc = response.json()['location']['title']
tweet = ("Stay Alert! Sudden braking at: ", loc)
status = api.update_status(status=tweet)
print(status)
now = datetime.datetime.now()
now = str(now)
tweetMsg = "Stay Alert! Sudden braking at: ", loc, "on", now
api.update_status(status=tweetMsg)
#print(status)
print(tweetMsg)
exit
################################
# Fetching Details from Zomato #