Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save johanndiedrick/425938f6a9aeb817834a9a0d02086abf to your computer and use it in GitHub Desktop.
Save johanndiedrick/425938f6a9aeb817834a9a0d02086abf to your computer and use it in GitHub Desktop.
import tweepy
import json
from datetime import timezone
import datetime
response = requests.get('https://scanmap.frnsys.com/NY/log')
json_data = json.loads(response.text)
# Getting the current date
# and time
dt = datetime.datetime.now()
utc_time = dt.replace(tzinfo = timezone.utc)
utc_timestamp = utc_time.timestamp()
print(utc_timestamp)
print(len(json_data['logs']))
latest_logs = [x for x in json_data['logs'] if x['timestamp'] > utc_timestamp]
print(len(latest_logs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment