Skip to content

Instantly share code, notes, and snippets.

############################################################################
# Sample Algorithm
import pandas as pd
import talib as ta
import numpy as np
def initialize(ctx):
# 設定
import requests
import time
import os
def download():
URL = 'http://www.boj.or.jp/announcements/release_2018/k180731a.pdf'
response = requests.get(URL)
if response.status_code == 200:
with open('./k180731a.pdf', 'wb') as f:
f.write(response.content)
@nrm176
nrm176 / gist:002d9d46e0ea65e0792e0dffaa522eb5
Last active November 27, 2018 02:32
日経新聞から任意の業種を主力事業としている企業のコードを抜き出す
@nrm176
nrm176 / kabutan.md
Last active November 27, 2018 04:01
株探の任意のページから証券コードのみを抽出するスニペット

How to use

  1. Open any web page on Kabutan with Chrome

  2. Open Chrome Developer Tool, copy and paste the following code on its console, and then execute it

Array.from(document.querySelectorAll('div#main article div.body a')).filter((e) => {return e.href.includes('stock/?code=')}).map((e)=>{return e.innerText}).filter((e)=>{return e.length == 4})
@nrm176
nrm176 / gist:b360ca9f18b17b6bf2bdce1fb3de82f7
Created December 4, 2018 08:51
BoJの桜レポート
const axios = require("axios");
var HTMLParser = require('fast-html-parser');
const jsdom = require("jsdom");
var iconv = require('iconv-lite');
const { JSDOM } = jsdom;


const URL = 'https://www.boj.or.jp/research/brp/rer/index.htm'
@nrm176
nrm176 / edinet_api.py
Created March 18, 2019 08:39
New EDINET API
import requests, zipfile, io
HEADERS = {
'User-Agent': 'My Sample Edinet API app',
}
def getDocumentList():
# 書式一覧API
# GET https://disclosure.edinet-fsa.go.jp/api/v1/documents.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nrm176
nrm176 / kabutan_article.js
Created April 9, 2019 02:23
Get security codes from Kabutan article
Array.from(new Set(Array.from(document.querySelectorAll('div.mono a')).map((e)=>{return e.textContent}).filter((e)=>{ return e.length == 4 }))).join(', ')