Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'rubygems'
require 'rubytter'
require 'oauth'
require 'yaml'
require 'pp'
CONSUMER_KEY = ''
CONSUMER_SERCRET = ''
@kayakaya
kayakaya / zenback.rb.diff
Created March 17, 2011 06:33
diff of zenback.rb
diff --git a/plugin/zenback.rb b/plugin/zenback.rb
index c6717a5..9e1ffc9 100644
--- a/plugin/zenback.rb
+++ b/plugin/zenback.rb
@@ -3,7 +3,25 @@
# You can redistribute it and/or modify it under GPL.
if @mode == 'day'
add_body_leave_proc do
- @conf['zenback.script'] || ''
+ <<-HTML
diff --git a/plugin/flickr.rb b/plugin/flickr.rb
index 9c82f83..dd8ea99 100644
--- a/plugin/flickr.rb
+++ b/plugin/flickr.rb
@@ -18,10 +18,12 @@
# Copyright (c) MATSUOKA Kohei <http://www.machu.jp/>
# Distributed under the GPL
#
-require 'open-uri'
+require 'net/http'
@kayakaya
kayakaya / gist:850906
Created March 2, 2011 13:14
diff of bitly.rb
diff --git a/plugin/bitly.rb b/plugin/bitly.rb
index c296d24..e07e131 100644
--- a/plugin/bitly.rb
+++ b/plugin/bitly.rb
@@ -13,7 +13,7 @@
#
require 'json'
-require 'open-uri'
+require 'net/http'
Gitの練習用
* forkしたリポジトリ間でのpush/pullを学習する
* gityに変更してみた
* mergeしなくてもログには記録されるのか
* Emacs no iro gawakarimasen
* ここはCotEditorで追加
* ここはgithubのWeb UIで追加
* gits.githubからの追加
Index: search-yahoo.rb
===================================================================
--- search-yahoo.rb (revision 38277)
+++ search-yahoo.rb (working copy)
@@ -11,9 +11,10 @@
# @options['search-yahoo.result_filter'] : your dialy's URL format of DAY mode into Regexp.
#
-require 'open-uri'
require 'timeout'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/Users/kayakaya/.rvm/rubies/ruby-1.9.1-p378/bin:$PATH</string>
</dict>
<key>Label</key>
#!/usr/bin/env ruby
require 'webrick'
require 'tempfile'
$EDITOR = '/Users/kayakaya/Applications/Emacs.app/Contents/MacOS/bin/emacsclient'
$PORT = 9292
server = WEBrick::HTTPServer.new(:Port => $PORT)
trap('INT') { server.shutdown }
# latlonglab_route.rb
# modify plugin written by <http://elpeo.jp/diary/20091228.html#p01>
def route( id, w = 480, h = 480 )
if feed? or @conf.mobile_agent?
return %Q|<p><a href="http://latlonglab.yahoo.co.jp/route/watch?id=#{id}">Link to LatLongLab Route</a></p>|
end
if @conf.iphone?
#
# yahoo_map.rb - embeded Yahoo! Japan Map for tDiary
#
# Copyright (C) 2010, KAYA Satoshi <kayakaya@kayakaya.net>
# You can redistribute it and/or modify it under GPL2.
#
add_header_proc do
init_ymap
if @conf['yahoo_jp.appid'] and @conf['yahoo_jp.appid'].size > 0