Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View guoylyy's full-sized avatar

锅蜀黍 guoylyy

  • 上海以虎科技有限公司
  • Shang Hai, China
View GitHub Profile
@guoylyy
guoylyy / JavaScript Date Format
Last active August 29, 2015 14:05
Format Date
Date.prototype.format =function(format)
{
var o = {
"M+" : this.getMonth()+1, //month
"d+" : this.getDate(), //day
"h+" : this.getHours(), //hour
"m+" : this.getMinutes(), //minute
"s+" : this.getSeconds(), //second
"q+" : Math.floor((this.getMonth()+3)/3), //quarter
"S" : this.getMilliseconds() //millisecond
@guoylyy
guoylyy / gist:7a776db486ff40bb156c
Last active August 29, 2015 14:02
SSE News Getter
from urllib.request import urlopen
from bs4 import BeautifulSoup
import pymysql
# database arrangement
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='root', db='sse', charset='utf8')
cur = conn.cursor()
# for all news
def parse_news(url):