Skip to content

Instantly share code, notes, and snippets.

# frozen_string_literal: true
dirs = Dir.glob('*/')
pwd = Dir.pwd
dirs.each do |dir|
# git の管理下にありそうな場合はそこに移動して fetch する
next unless Dir.exist?("#{pwd}/#{dir}.git/")
Dir.chdir "#{pwd}/#{dir}"
// CoinGeckoからモナコイン、Bitzeny、Ethereumの価格を取得して、Discordに投稿
// Google Apps Script用のソースコードです
// 毎日1度実行するようにしています
function postDiscord() {
//payload
var payload = {
'username': "(*゚ー゚)",
'content' : "モナコイン:" + getMONAJPYByCoinGeko() + "/ Bitzeny:" + getZenyJPYByCoinGeko() + "/ Ethereum:" + getETHJPYByCoinGeko() + "\n", // \n で改行
'parse' : "full"
@oosawa
oosawa / create_base_data.py
Created March 2, 2018 11:47
マルコフ連鎖生成プログラムを使ったDiscordへの返信用Bot(Windows用)
#coding:utf-8
import random
def create_base_data(filename, outfile, add_line, limit):
file = open(filename,'r', encoding="utf-8")
data = file.readlines()
file.close()
data = random.sample(data, limit) # ランダムに何行か抜く
# ファイルに書き出し
file = open(outfile, 'w', encoding='utf-8')
@oosawa
oosawa / reply.py
Last active February 28, 2018 14:22
マルコフ連鎖生成プログラムを使ったDiscordへの無差別投稿用Bot
#coding:utf-8
# ディレクトリの中にInuフォルダを作って、MarkovInu.exe などを放り込んで動かします
# Windows10 + Python3.6.4
import discord
import os
import subprocess
from subprocess import Popen
from time import sleep
import random