From 4e4d7d9bb4e15d78fd3d20e1d01533b34f3dd58b Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 29 May 2019 21:39:23 +0530 Subject: [PATCH] Trying to fixtweet loop error :/ --- pythonProgram/main.py | 11 ++++++++--- 1 file 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 #