Skip to content

Instantly share code, notes, and snippets.

View takashifuruya0's full-sized avatar

takashifuruya0

View GitHub Profile
@takashifuruya0
takashifuruya0 / file0.txt
Last active January 30, 2018 21:40
herokuのPostgresql row数を圧迫するdjango_admin_logを削除 ref: https://qiita.com/tfuruya/items/e3eab603ed186fe9877a
brew install postgresql
@takashifuruya0
takashifuruya0 / file0.js
Last active January 10, 2018 03:11
GASでスクレイピング:SUUMOから賃貸物件情報を取得 ref: https://qiita.com/tfuruya/items/7798e0f3188a2795319e
function doCurl(){
// SUUMOのURL
var url = "https://suumo.jp/chintai/bc_100106732165/?suit=STfr20160902000"
main(url)
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// main:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function main(url){
function doGet(e) {
// listデータをjsonに変換
payload = JSON.stringify(get_kakeibo())
// payloadをreturnするだけではだめ
// ContentServiceを利用して、responseを作成
ContentService.createTextOutput()
var output = ContentService.createTextOutput();
output.setMimeType(ContentService.MimeType.JSON);
output.setContent(payload);
// return response-data
@takashifuruya0
takashifuruya0 / index.html
Last active March 21, 2018 07:07
Djangoにmatplotlibで円グラフ表示 ref: https://qiita.com/tfuruya/items/f9de3039ad2d60b09c7b
<!doctype html>
<html lang="en">
<head>
<title>hello</title>
</head>
<body>
<img src="/gas/charts/simple2.png" alt="">
</body>
</html>
@takashifuruya0
takashifuruya0 / file0.js
Created November 15, 2017 14:37
英語学習システムをSlackとGASで作る ref: https://qiita.com/tfuruya/items/2f577f6e1311a2f9c8c2
function doPost(e) {
// token確認
var verify_token = LogGasApp.token_learning;
if (verify_token != e.parameter.token || e.parameter.user_name=="slackbot") {
throw new Error("invalid token.");
}
// check trigger_word
var trword = e.parameter.trigger_word;
@takashifuruya0
takashifuruya0 / file0.js
Last active November 14, 2018 18:25
Slackから,GAS経由でスクレイピングして,株価を取得 ref: https://qiita.com/tfuruya/items/0cf641d3477cd5fddfae
//=======================================================
// doPost: Slack-GASのGateway
//=======================================================
function doPost(e) {
var verify_token ="TOKEN"; //outgoing-webhooks
var contents=e.postData.contents;
var channelID = "#"+e.parameter.channel_name;
var word = e.parameter.trigger_word;
var message = "";
@takashifuruya0
takashifuruya0 / file0.js
Created October 26, 2017 14:16
Knowledgeの更新通知を、GAS経由で、Slackで受け取る方法 ref: http://qiita.com/tfuruya/items/b16c124cb083e5b6ade6
function doPost (e) {
// << PostData の処理 >>
var org_post = e.postData.contents;
var contents = JSON.parse(org_post);
var knowledge = contents;
var sheet = sheet_knowledge;
// << 分岐 >>
// <1.comment>