aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2019-05-29 21:39:23 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2019-05-29 21:39:23 +0530
commit4e4d7d9bb4e15d78fd3d20e1d01533b34f3dd58b (patch)
treee687b0e167fc522fd205f8c2652393bb52dcc261
parent5448c0a18ddc515a41d13d38b871aecdf37eafae (diff)
Trying to fixtweet loop error :/1.0
-rwxr-xr-xpythonProgram/main.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pythonProgram/main.py b/pythonProgram/main.py
index de977f5..5fd558a 100755
--- a/pythonProgram/main.py
+++ b/pythonProgram/main.py
@@ -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 #