Last active
June 27, 2017 16:39
-
-
Save bunseokbot/d84356dba8892397c4b3f08f6f8ccd16 to your computer and use it in GitHub Desktop.
비오비 6기 발표 확인 스크립트
This file contains 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 requests | |
import re | |
import time | |
import webbrowser | |
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2"} | |
lastnum = 85 | |
def chk_new_post(): | |
global headers, lastnum | |
data = requests.get("https://www.kitribob.kr/board/1", headers=headers).text | |
count = re.findall(r"list_obj\.init\(\{\"total_cnt\":\"([0-9]+)\"", data)[0] | |
if int(count) > lastnum: | |
postnum = re.findall(r"\[\{\"board_no\":\"([0-9]+)\"",data)[0] | |
url = "https://www.kitribob.kr/board/detail/1/{}".format(postnum) | |
webbrowser.open_new(url) | |
return True | |
while True: | |
if chk_new_post(): | |
print("BoB new post found") | |
time.sleep(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Unknown84 Oh! using webbrowser library to open BoB website post is a great idea!