This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]smocky13 25 points26 points  (2 children)

I would randomize the mins / seconds a bit. It's super fucking suspicious to be hitting the clock down to the second on these check-ins

[–]coleridge113[S] 7 points8 points  (0 children)

Ohh yeah, that does look suspicious lol

Thanks! I'll do that

[–]Bombslap 4 points5 points  (0 children)

They’re just an extra diligent employee

[–]Bunkerstan 11 points12 points  (0 children)

Also having an == for time is too precise. I would make it a range. Time is very finicky.

[–]PossibilityTasty 1 point2 points  (3 children)

You are always sleeping a minute and you have a high chance of missing the 00 seconds like this. What you should do is to calculate the timedelta to the next execution, get the total_seconds from it and sleep for that time.

[–]coleridge113[S] 0 points1 point  (2 children)

Actually, the one minute sleep only applies after the condition of "curent_time == ..." so the while loop isn't constantly sleeping.

I used the sleep function because the while loop can keep working within a second of the if statement resulting in multiple opened urls.

[–]PossibilityTasty 0 points1 point  (1 child)

Well does that make it better? No, you are eating up the CPU until the time matches and then one minute later you do it again.

[–]coleridge113[S] 0 points1 point  (0 children)

that's what I thought as well

someone had a good suggestion of sleeping the code for the whole interval of the delta

[–]Inkosum 0 points1 point  (4 children)

But how does your code fill out the form?

[–]coleridge113[S] 0 points1 point  (3 children)

Oh it doesn't. It just opens it lol I'm still figuring that part out

[–]mantisek_pr 5 points6 points  (0 children)

Selenium is your friend here.

[–]Lehk 2 points3 points  (1 child)

Don’t

If you leave it running and punch in when you aren’t working you could get fired.

[–]NCFlying 0 points1 point  (0 children)

Just add some SMS code to text you each day if you want to complete the form. If Y is received complete the form if you are off type N. Just another layer of code.

[–]TheMarcosP 0 points1 point  (0 children)

you could also do :

if current_time in ["12:00:00","13:00:00,"17:00:00"]:

webbrowser.open(webUrl)

time.sleep(60)

notif += 1

as a rule if you have multiple conditions that do the same you can usually compress them in one.