-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbapcs.py
32 lines (23 loc) · 997 Bytes
/
bapcs.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
import time
from colorama import init, Fore
import feedparser
init(autoreset=True)
def cool():
while True:
time.sleep(10)
with open(f'bapcs.txt','r') as log:
lastsent = log.read()
Feed = feedparser.parse('https://www.reddit.com/r/buildapcsales/new/.rss')
send = True
for i in Feed.entries:
if i.title == lastsent:
send = False
if send == True:
print(Fore.RED + '\n~~~~~~~~~~~~~~~~~~~~~\n')
print(Fore.RED + i.title)
print(Fore.RED + i.authors[0].name)
print(Fore.RED + str(i.updated_parsed[1]) + '/' + str(i.updated_parsed[2]) + '/' + str(i.updated_parsed[0]) + ', ' + str(i.updated_parsed[3])
+ ':' + str(i.updated_parsed[4]) + ' UTC')
if i == Feed.entries[0]:
with open(f'bapcs.txt','w') as log:
log.write(str(i.title))