Skip to content

Instantly share code, notes, and snippets.

@InJeCTrL
InJeCTrL / prefix.py
Last active April 7, 2019 10:40
Mindgo日线/120分钟线价格拉取与数据预处理
'''
获取单支股票日线
包括所有行情数据,每800支股票分卷
'''
import pandas as pd
import zipfile
def ZF(FileList_in,ZFileName_out):
f = zipfile.ZipFile(ZFileName_out, 'w')
for file in FileList_in:
@InJeCTrL
InJeCTrL / gist:e49cc2388ff6fd97b0357367481c5670
Last active September 28, 2020 02:24
超星网课视频
function goNext(now){
if (now.nextElementSibling != null){
now.nextElementSibling.getElementsByTagName("a")[0].click();
}
else if (now.parentNode.nextElementSibling != null){
now.parentNode.nextElementSibling.getElementsByTagName("a")[0].click();
}
else if (now.parentNode.parentNode.nextElementSibling != null){
now.parentNode.parentNode.nextElementSibling.getElementsByTagName("a")[0].click();
}
BiliBili:
var reg = /https:\S*?sig=no/;
addr = reg.exec(document.getElementsByClassName("script-requirement")[0].innerHTML)[0];
window.open(addr.replace(/\\u002F/g,"/"));
@InJeCTrL
InJeCTrL / gist:17064d374b5fa39ec7c8211f50e207ca
Created March 26, 2019 06:33
MindGo下载股票财务数据(分季度文件)
print("开始获取全部数据集...")
q1 = query(growth,cashflow,balance,income,growth_sq,income_sq,cashflow_sq,profit_sq,asharevalue,ashareprofit,ashareoperate,asharedebt)#08~
q2 = query(growth,cashflow,balance,income,growth_sq,income_sq,cashflow_sq,profit_sq)#05~07
print("全部数据集获取完成,开始查询...")
for y in range(2005,2020,1):
print("开始查询"+str(y)+"年的财务数据...")
for i in range(1,5,1):
aaa=str(y)+"q"+str(i)
days = get_trade_days(str(y)+'0101', str(y)+'1231').strftime('%Y%m%d').tolist()
if y <= 2007:
@InJeCTrL
InJeCTrL / gist:5a388c0862096992ec4c3395553ed529
Created March 26, 2019 06:37
MindGo下载股票特色数据-事件与特色数据
print("开始.......")
q = query(sport_event)
print("开始查询.......")
df = get_important_matters(q)
print("完成查询........开始写入........")
for a in range(0, len(df), 300000):
if a+300000 >= len(df):
dfw = df[a:len(df)-1]
else:
dfw = df[a:a+300000]
@InJeCTrL
InJeCTrL / gist:39bd3e4426300cf756b133c607a9ec4a
Created March 26, 2019 06:41
MindGo下载股票因子数据(对年分卷压缩)
import zipfile
def ZF(FileList_in,ZFileName_out):
f = zipfile.ZipFile(ZFileName_out, 'w')
for file in FileList_in:
f.write(file)
f.close()
return ZFileName_out
print("开始查询2005-2019年所有交易日的因子数据...")
@InJeCTrL
InJeCTrL / A&B.JS
Last active April 13, 2019 14:44
永硕E盘下载Doc/Docx文档(文件名无空格)
#Segment 1 - Open All Folders to show file trees
FolderNum = document.getElementsByClassName("ml").length
for (var i=0;i<FolderNum;i++)
{
document.getElementsByClassName("ml")[i].click()
}
document.getElementsByClassName("ml")[FolderNum-1].click()
#Segment 2 - Find download URLs textfile and download
var reg = /ys-.\.ys168\.com\/\S*\.doc[x]?/g;
src = document.getElementById("mainMenu").innerHTML
@InJeCTrL
InJeCTrL / population.py
Created April 13, 2019 08:07
MostPopulationPics
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('population.csv',skiprows=3)
df.set_index('Country Code',inplace=True)
excep = ['EAP','SAS','TEA','TEC','TLA','TMN','TSA','TSS',
'IBT','IDA','IDB','OED','HIC','LTE','PRE','PST',
'IDX','SSA','LDC','ECS','HPC','LIC','LCN','LAC',
'EUU','FCS','LMY','MIC','IBD','EAR','LMC','UMC',
'EAS','SSF','MEA','ECA','ARB','MNA','NAC','EMU',
@InJeCTrL
InJeCTrL / download_index.py
Last active November 23, 2025 17:50
MindGo下载股票指数数据
//JS获取table列
var str = null;
var obj = document.getElementById(123)
var len = obj.rows.length
for (var i = 1;i<len;i++)
{
str += "\"";
str += obj.rows.item(i).cells.item(0).innerHTML;
str += "\",";
}
@InJeCTrL
InJeCTrL / rush.js
Last active July 7, 2019 16:05
某网课无人值守
var courseURLList = [];
var index_ID = -1;
var lastHour = 0;
var lastMinute = 0;
var lastSecond = 0;
getCourseList();
nextVideo();
var _timer = setInterval
(