browse.py has 3 duplicate time functions doing similar things #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The file
skills/polymarket-browse/scripts/browse.pycontains three functions that parse event timestamps and return formatted time strings:get_match_time_status(e)(line 222) - Returns(status_str, urgency)where urgency is 0-3get_match_time_str(e)(line 272) - Returns just the time status string (e.g. "LIVE", "In 6h")get_start_time_wib(e)(line 417) - Returns(date_time_str, relative_str)with absolute WIB time and relative timeAll three functions:
startTimeorstartDatefrom the eventThis is classic code duplication. They should be consolidated into a single function that returns all needed time information (absolute time, relative string, and urgency level).
Suggested fix: Create a single unified time function that returns a dict or tuple with all time-related data, and have the existing functions call it. This would make the code more maintainable and ensure consistent time handling.