Skip to content

Instantly share code, notes, and snippets.

View toofusan's full-sized avatar

Toru Yoshioka toofusan

View GitHub Profile
@toofusan
toofusan / referer.js
Created October 8, 2016 06:50
Webサイト内で「あるURLにどのURLからリンクしているか」抽出する
"use strict";
const client = require("cheerio-httpcli");
const URL = require("url");
const fs = require("fs");
// 共通変数
const MAX_LEVEL = 5; // 最大遷移回数
// URL
if (!process.argv[2]) console.log("No argument");
@toofusan
toofusan / navitime-train-search.coffee
Created October 23, 2016 02:36
Navitimeをスクレイピングして電車時刻検索を行う
# ---------------------
# Description
# ---------------------
# hubot用の電車時刻検索スクリプト(Navitimeをスクレイピング)
# 'train 銀座 渋谷 1730' -> 銀座を出て17:30に渋谷に到着する電車を検索
# 'train now 銀座 渋谷' -> いまから銀座を出て渋谷に到着する電車を検索
module.exports = (robot) ->
# 到着時刻を指定して電車検索
@toofusan
toofusan / a4typobot.js
Last active December 16, 2016 14:59
twitter bot with tumblr image http://a4typo.tumblr.com/
'use strict';
// Tumblr Authenticate
const Tumblr = require('tumblr.js');
const tumblr = Tumblr.createClient({
consumer_key: '...',
consumer_secret: '...',
token: '...',
token_secret: '...'
});
<!doctype html>
<html>
<head>
<title>Socket.IO chat</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px "Source Sans Pro", Helvetica, Arial, 游ゴシック体, YuGothic, メイリオ, Meiryo, sans-serif; }
#top-fixed {padding 5px 0px; position: fixed; top: 0; width: 100%;}
#bottom-fixed {padding 5px; position: fixed; bottom: 0; width: 100%;}
#container { padding: 15px 5px;}
@toofusan
toofusan / JsonHelper.cs
Last active February 26, 2017 15:23
TwitterAPIClient for UnityWebRequest (beta)
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
public class JsonHelper {
public static string ArrayToObject (string arrayString) {
if (arrayString.StartsWith ("[")) {
arrayString = "{\"items\":" + arrayString + "}";
@toofusan
toofusan / FreeeEventHandler.cs
Last active November 30, 2018 15:19
freee APIを使ったVR勤怠打刻の実装例
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Freee;
public class FreeeEventHandler : MonoBehaviour {
Freee.Client client;