Trying to fixtweet loop error :/
This commit is contained in:
parent
5448c0a18d
commit
4e4d7d9bb4
|
@ -4,6 +4,7 @@ Modular Road-Safety Toolkit
|
||||||
"""
|
"""
|
||||||
#pylint: disable=C0103,C0111
|
#pylint: disable=C0103,C0111
|
||||||
import argparse
|
import argparse
|
||||||
|
import datetime
|
||||||
import time
|
import time
|
||||||
import overpy
|
import overpy
|
||||||
import simplejson as sjson
|
import simplejson as sjson
|
||||||
|
@ -99,9 +100,13 @@ def tweetMe():
|
||||||
url = 'https://developers.zomato.com/api/v2.1/geocode'
|
url = 'https://developers.zomato.com/api/v2.1/geocode'
|
||||||
response = requests.get(url, headers=headers, params=params)
|
response = requests.get(url, headers=headers, params=params)
|
||||||
loc = response.json()['location']['title']
|
loc = response.json()['location']['title']
|
||||||
tweet = ("Stay Alert! Sudden braking at: ", loc)
|
now = datetime.datetime.now()
|
||||||
status = api.update_status(status=tweet)
|
now = str(now)
|
||||||
print(status)
|
tweetMsg = "Stay Alert! Sudden braking at: ", loc, "on", now
|
||||||
|
api.update_status(status=tweetMsg)
|
||||||
|
#print(status)
|
||||||
|
print(tweetMsg)
|
||||||
|
exit
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# Fetching Details from Zomato #
|
# Fetching Details from Zomato #
|
||||||
|
|
Loading…
Reference in New Issue