Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@tily
tily / rubytter4twitter4r.rb
Created May 6, 2010 14:55
rubytter4twitter4.rb
require 'rubygems'
require 'oauth'
require 'rubytter'
require 'mechanize'
module Twitter
class Client
def initialize(config)
@config = config
@rubytter = OAuthRubytter.new(access_token)
@tily
tily / bot.rb
Created June 6, 2010 07:29
twitter bot library for lazy maintainers
#!/usr/bin/env ruby
require 'tokyotyrant'
require 'rubygems'
require 'oauth'
require 'pit'
require 'json'
class Bot
include TokyoTyrant
require "rubygems"
require "highline"
require "mechanize"
hl = HighLine.new
email = hl.ask('E-mail: ')
password = hl.ask('Password: '){|q| q.echo = '*'}
list = []
@hitode909
hitode909 / always_140.rb
Created June 26, 2010 02:39
termtterで必ず140文字投稿する
module Termtter::Client
register_hook(
:name => :always_140,
:points => [:modify_arg_for_update],
:exec_proc => lambda {|cmd, body|
body.chomp!
max = 140
len = body.split(//).length
mod = max % len
ext = (0...len).to_a.sort_by{ rand }.take(mod)
// ==UserScript==
// @name Togetter: Block all users
// @namespace http://lowreal.net/
// @include http://togetter.com/li/*
// @require http://github.com/cho45/jsdeferred/raw/master/jsdeferred.userscript.js
// @require http://gist.github.com/3239.txt#createElementFromString
// ==/UserScript==
// https://gist.github.com/454574
(function () { with (D()) {
@hitode909
hitode909 / termtter-bashodb-itdajare.rb
Created July 22, 2010 09:46
termtterから#itdajare投稿する
require 'uri'
require 'open-uri'
require 'nokogiri'
require 'nkf'
module BashoDB
def self.get
db.choice
end
module RSpec
module Core
module Formatters
class ProgressFormatter
alias _example_failed example_failed
def example_failed(example)
_example_failed(example)
system 'say "failed" &'
system 'growlnotify -p 1 -t "spec failed" -m "failed" &'
system 'glitch'
## うどん
+ 鍋に水と昆布を入れて沸かす
++ 鶏肉とか入れるならここで入れる
+ 削り節をひとつかみ入れる
+ 薄口醤油とみりんを適当に入れる
+ 適当に短冊に切った白ネギを入れる
++ 辛味がほしいならここで輪切りの唐辛子とかを入れる
+ 一煮立ちするまで卵を溶く
+ 沸いたら冷凍うどんを入れる
+ 冷凍うどんがほぐれたら卵を入れる
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
@satyr
satyr / hatena_graph_previewer.user.js
Created September 18, 2010 13:13
Hatena Graph Previewer
// ==UserScript==
// @name Hatena Graph Previewer
// @namespace http://twitter.com/m_satyr
// @include http://graph.hatena.ne.jp/*/edit*
// @license X
// ==/UserScript==
var gedit = document.getElementById('graphedit');
var table = gedit.querySelector('table');
var graph = gedit.appendChild(new Image);
var titles = document.getElementById('titlecel').children;