Skip to content

Instantly share code, notes, and snippets.

@hail2u
Created May 15, 2009 22:18
Show Gist options
  • Save hail2u/112465 to your computer and use it in GitHub Desktop.
Save hail2u/112465 to your computer and use it in GitHub Desktop.
えこ
// ==UserScript==
// @name Gomidashi
// @namespace http://hail2u.net/
// @description eco.
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// ==/UserScript==
window.addEventListener('load', function () {
var garbageSchedule = [
["-"], // 日曜日
["燃やせるゴミ", "生ゴミ"],
["紙", "布"],
["ペットボトル"],
["燃やせるゴミ", "生ゴミ"],
["缶", "びん", "蛍光管", "電球", "乾電池", "その他プラスチック", "燃やせないごみ"],
["容器包装プラスチック", "使用済み食用油"] //土曜日
];
if (unsafeWindow.gmonkey) {
unsafeWindow.gmonkey.load('1.0', function (gmail) {
var masthead = gmail.getMastheadElement();
var searchBox = masthead.getElementsByTagName("input")[0];
var garbageTypes = garbageSchedule[new Date(Date.now() + 14 * 60 * 60 * 1000).getDay()].join("、");
window.setTimeout(function () {
if (!searchBox.value) {
searchBox.addEventListener("focus", function (e) {
this.select();
}, false);
searchBox.value = garbageTypes;
}
}, 1000);
});
}
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment