-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswitch.py
48 lines (32 loc) · 797 Bytes
/
switch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# Copyright (c) 2021 Corey White
import nntplib
import string
import sys
import os
import time,datetime
t = datetime.datetime.today()
print("\n[Current Time]\n")
print(t)
print("\n[Time Of Future Post]\n")
print("Year: ")
year = int(input())
print("Month: ")
month = int(input())
print("Day: ")
day = int(input())
print("Hour: ")
hour = int(input())
print("Minute: ")
minute = int(input())
future = datetime.datetime(year,month,day,hour,minute)
while(1):
if future < t:
server = nntplib.NNTP('news.eternal-september.org', user='name', password='password')
f = open(sys.argv[1], 'rb')
server.post(f)
server.quit()
if os.path.exists(sys.argv[1]):
os.remove(sys.argv[1])
quit()
t = datetime.datetime.today()