Skip to content

Instantly share code, notes, and snippets.

@bunseokbot
Last active June 27, 2017 16:39
Show Gist options
  • Save bunseokbot/d84356dba8892397c4b3f08f6f8ccd16 to your computer and use it in GitHub Desktop.
Save bunseokbot/d84356dba8892397c4b3f08f6f8ccd16 to your computer and use it in GitHub Desktop.
비오비 6기 발표 확인 스크립트
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)
@lj1nu
Copy link

lj1nu commented Jun 27, 2017

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:
    url = "https://www.kitribob.kr/board/detail/1/"+re.findall(r"\[\{\"board_no\":\"([0-9]+)\"",data)[0]
    webbrowser.open_new(url)
    return True

while True:
if chk_new_post():
print("BoB new post found")
time.sleep(10)

@junorouse
Copy link

와 멋져욤

@bunseokbot
Copy link
Author

@Unknown84 Oh! using webbrowser library to open BoB website post is a great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment