Skip to content

Instantly share code, notes, and snippets.

View suchi's full-sized avatar
👨‍💼

suchi suchi

👨‍💼
View GitHub Profile
@suchi
suchi / martinbaker.rb
Last active June 28, 2022 04:55
calling URI.open via Kernel#open is deprecated, call URI.open directly
# coding: utf-8
# martin bakerから助かった人の数を取得する
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'date'
html = Nokogiri::HTML(URI.open('https://www.martin-baker.com/'))
count = html.search('h1>span')[0].text.to_i
date = Date.today.strftime("%Y/%m/%d")
@suchi
suchi / amazon-calc.js
Created January 4, 2019 01:47 — forked from koyopro/amazon-calc.js
Amazonで一年間に使った金額と、注文履歴のTSVを出力するブックマークレット【2015年版】
// Amazonの注文履歴をTSV形式で出力するスクリプト
//
// 2015-01-01 時点での DOM 構造に対応, GoogleCrome, Opera でテスト済。
// formatEntry関数を書き換えれば自由な書式で出力できます。
//
// 参考:
// - Amazonの注文履歴をCSV形式にして出力するスクリプト
// https://gist.github.com/arcatdmz/8500521
// - Amazon で使った金額の合計を出す奴 (2014 年バージョン)
// https://gist.github.com/polamjag/866a8af775c44b3c1a6d
#!/usr/bin/env ruby
file = File.open("index.html", "r:iso-2022-jp:UTF-8")
content = file.read
all_html = <<HTML
<html>
<head>
<meta http-requiv="Content-Type" content="text/html;charset=utf-8">
<meta name="Author" content="Aoki Minero">
// ==UserScript==
// @name Cybozu Holiday Wordwarp
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Enablle holidy wordwrap
// @author suchi
// @match
// @grant none
// ==/UserScript==