Skip to content

Instantly share code, notes, and snippets.

View return0927's full-sized avatar

Eunhak Lee return0927

View GitHub Profile
@return0927
return0927 / body.py
Created September 17, 2017 07:28
Naver CAFE Board Lookup
import codecs, requests
from bs4 import BeautifulSoup as bs
from settings import *
from time import time
setting = {}
class report():
def __init__():
_URL = "https://technet.microsoft.com/library/security/4010983"
import requests, bs4
reqBody = requests.get(_URL)
soup = bs4.BeautifulSoup(reqBody.text, "html.parser")
_BODY = soup.find("div", attrs={"id":"mainBody"})
_Tags = _BODY.find_all(['h2','p','span'])
_Splitter = []
@return0927
return0927 / _Ping_Inspecter.py
Created September 29, 2017 15:58
랜 네트워크에 연결된 호스트들을 탐색합니다 (핑 기반)
# -*- coding: utf-8 -*- python3
# Created At 2017.9.30
# For ARP.py
# By R3turn0927
# Github @return0927 | Facebook @R3turn.01 | KakakoTalk @bc1916
from scapy.all import *
from subprocess import getoutput
import threading as 멀티코어
@return0927
return0927 / parse-BUGS-chart.py
Created October 17, 2017 16:34
음원사이트 "벅스" 에서 차트를 파싱해옵니다.
from urllib.request import urlopen
from bs4 import BeautifulSoup
url = urlopen("http://music.bugs.co.kr/chart/track/day/total?chartdate=20171018")
soup = BeautifulSoup(url, 'lxml')
cnt_artist = 0
cnt_title = 0
for tag in soup.find_all("p", attrs={"class":"artist"}):
cnt_artist += 1
from random import choice
class RSP():
def __init__(self):
self.msg = {
"case": {
"win": "당신이 이겼습니다!",
"lose": "당신이 졌습니다!",
"draw": "비겼습니다!"
import requests
from datetime import datetime, timedelta
class _IRIS:
def __init__(self):
self.api = "http://service.iris.edu/irisws/timeseries/1/query" \
"?output=plot" \
"&ref=direct" \
"&width=600" \
import threading
from time import time
from tools import _IRIS
from tkinter import *
from io import BytesIO
from PIL import Image, ImageTk
IRIS = _IRIS()
IRIS.updateSeismometer("KG", "TJN")
@return0927
return0927 / Amicable Number.py
Last active April 22, 2018 06:47
1부터 자연수 n까지의 친화수를 모두 구해줌.
from time import time # 현재 timestamp를 불러오는 함수
"""함수부분"""
def division(n, stack=list(), num=1):
"""
재귀함수의 방법으로
1부터 자연수 n까지의 양의 진약수를 모두 구함.
:param n: 약수를 구하려는 자연수
:param stack: 현재까지 구한 양의 양수 (초기화를 위해 Default로 `list()`를 주어야함)
:param num: 현재 나누려는 수
@return0927
return0927 / 윤년.py
Created April 22, 2018 07:24
윤년계산 3가지 방식
from time import time
"""함수정의"""
leap_check = lambda n: not (n % 400) or ((n % 400) and (n % 100) and not (n % 4))
def leap_check2(n):
if not n % 400: return True
elif n % 100 and not n % 4: return True
else: return False
@return0927
return0927 / BLSoft-monitor.py
Created May 25, 2018 16:49
비엘소프트사, 대전중앙고의 방과후신청사이트의 현황을 로그파일로 저장해주는 모니터 스크립트입니다. (2018 3차방과후신청 기준)
from requests import get
from time import time, strftime
lectures = [454, 462, 461, 460, 457, 459, 458, 455, 456, 470, 471, 468, 466, 467, 464, 465, 463, 469]
titles = {"454": "고전시가강독반2 [오창학, 2-1]", "462": "농구 3on3 경기반 [이원규, 운동장 및 체육관]", "461": "물리탐구반 [김태수, 2-8]",
"460": "손에잡히는 생명과학 [임언식, 2-9]", "457": "솔루션 독해 [오향희, 2-5]", "459": "수리연구반 [백흥관, 2-7]",
"458": "수학문제해결력향상반 [임광선, 2-6]", "455": "창의영어독해반 [이진웅, 2-3]", "456": "홀로서는 독서와문법반 [이의준, 2-4]",
"470": "물리탐구반 [김태수, 2-8]", "471": "배구경기기능향상반 [이원규, 운동장 및 체육관]", "468": "사고력 신장반 [강윤화, 2-7]",
"466": "솔루션 독해 [오향희, 2-5]", "467": "쉬운미적분, 빠른미적분 [임광선, 2-6]", "464": "인간의 삶과 윤리 [홍지연, 2-2]",
"465": "토론실전반 [이의준, 2-4]", "463": "현대시 특강반 [이수정, 2-1]", "469": "화학개념응용반 [홍은희, 2-9]"}