Skip to content

Instantly share code, notes, and snippets.

@pooza
pooza / ganbae.play.aiscript
Created November 28, 2023 00:06
ぷいきゅあがんばえーー!!
/// @ 0.15.1
// おみくじぷりせっといじったよ
// ぷいきゅあがんばえーー!!
// 選択肢
var mioo = [
"[光の使者、キュアブラック!](https://www.youtube.com/watch?v=maiX-2d4R3w)"
"[光の使者、キュアホワイト!](https://www.youtube.com/watch?v=maiX-2d4R3w)"
"[輝く命、シャイニールミナス! 光の心と光の意志、全てを一つにするために!](https://www.youtube.com/watch?v=sR-dT4UMC-w)"
"[輝く金の花! キュアブルーム!](https://www.youtube.com/watch?v=HcWHcS142Kw)"
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
URL = 'https://timetreeapis.com/calendars/__CALENDAR__/upcoming_events?timezone=Asia/Tokyo&days=7&include=attendees'
TOKEN = '__TOKEN__'
require 'tomato_shrieker'
module TomatoShrieker
today = ARGV.first ? Time.parse(ARGV.first).to_date : Date.today
@pooza
pooza / instance_check.rb
Created January 1, 2023 23:38
鯖のリストから、サ終していそうなところをふるいにかけるやつ
#!/usr/bin/env ruby
require 'resolv'
require 'httparty'
require 'timeout'
File.read('./instances.txt').each_line(chomp: true) do |domain|
Timeout.timeout(10) do
Resolv::DNS.new.getaddress(domain)
code = HTTParty.get("https://#{domain}/nodeinfo/2.0.json").code
raise '404' if code == 404
@pooza
pooza / info.md
Last active September 18, 2022 09:06
TimeTree Personal Access Token
@pooza
pooza / delicious-party.rb
Last active January 9, 2022 05:19
デパプリニュースページをJSON化
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
require 'mulukhiya'
ROOT_URL = 'https://www.toei-anim.co.jp/tv/delicious-party_precure/'.freeze
SOURCE_URL = 'https://www.toei-anim.co.jp/tv/delicious-party_precure/news/'.freeze
Dir.chdir(dir)
@pooza
pooza / epg_recording.rb
Last active April 19, 2022 08:29
EPGStationの録画開始を投稿する、TomatoShriekerプラグイン。
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
require 'tomato_shrieker'
module TomatoShrieker
class ::Integer
def to_time
return Time.at(self / 1000)
@pooza
pooza / epg_reserve.rb
Last active April 19, 2022 08:29
EPGStationの予約のうち、特定キーワードを含むものの要約を投稿する、TomatoShriekerプラグイン。
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
require 'tomato_shrieker'
module TomatoShrieker
class ::Integer
def to_time
return Time.at(self / 1000)
@pooza
pooza / dai_anniv.rb
Last active April 27, 2022 05:09
「ダイの大冒険」に関連した記念日を標準出力に出力。tomato-shriekerと組み合わせ、BOT化可能。
#!/usr/bin/env ruby
dir = File.expand_path('..', __dir__)
$LOAD_PATH.unshift(File.join(dir, 'app/lib'))
ENV['BUNDLE_GEMFILE'] = File.join(dir, 'Gemfile')
CHARACTER_URL = 'https://mstdn.delmulin.com/api/character/v1/detail.json'.freeze
ANNIVERSARY_URL = 'https://mstdn.delmulin.com/api/anniversary/v1/common.json'.freeze
require 'tomato_shrieker'
module TomatoShrieker
@pooza
pooza / README.md
Last active December 7, 2021 07:58

twitter.comはノイズが多すぎる件

Twitterのアカウントを持たない者にとって、twitter.comのページはノイズが多すぎて利用しづらいのです。

機能

  • twitter.com宛てのリンクをnitter.net宛てに書き替えます。
  • 2秒ごとに実行されます。

動作環境

ユーザースクリプトですので、それを利用できる拡張機能を入れてください。

@pooza
pooza / purgeMails.gas
Last active February 14, 2020 21:35
Gmail上で、bulkラベルのついた古いメールを削除。
function purgeMails () {
const days = 30
const step = 500
const labels = ['label:bulk']
const date = new Date()
date.setDate(date.getDate() - days)
labels.map(label => {
let offset = 0
let threads = GmailApp.search(label, offset, step)