Created
June 2, 2020 21:09
-
-
Save johanndiedrick/425938f6a9aeb817834a9a0d02086abf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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