Skip to content

Instantly share code, notes, and snippets.

@kayakaya
kayakaya / gist:172154
Created August 21, 2009 16:19
Download Twitter friends and followers by Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'cgi'
username = ''
password = ''
def create_client(username, password)
Index: ja/section_footer2.rb
===================================================================
--- ja/section_footer2.rb (リビジョン 35100)
+++ ja/section_footer2.rb (作業コピー)
@@ -1,2 +1,4 @@
+# -*- coding: utf-8 -*-
# section_footer2.rb: Japanese resource
@section_footer2_delicious_label = "このエントリの del.icio.us history"
+@section_footer2_twitter_label = "このエントリにつぶやく"
Index: section_footer2.rb
@kayakaya
kayakaya / popit.rb
Created September 2, 2009 15:59
popit.rb:plugin embeddding POP on Popit
# popit.rb:plugin embedding POP on POPit(http://pop-it.jp)
#
# usage:
# popit(pop_id) - pop_id: The id of the POP on POPit (e.g. 1989 http://pop-it.jp/item/amazon/1989/pop/2000)
#
# Copyright (c) KAYA Satoshi <http://kayakaya.net/>
# You can redistributed it and/or modify if under GPL2.
#
def popit(pop_id, size = "large")
return unless pop_id
@kayakaya
kayakaya / friendfeed_badge.rb
Created September 8, 2009 15:55
friendfeed_badge.rb: show the FriendFeed profile picture plugin for tDiary
# friendfeed_badge.rb: show the FriendFeed profile picture plugin for tDiary
#
# Copyright (C) 2009 KAYA Satoshi <http://kayakaya.net/>
# Distributed under GPLv2.
#
require 'net/http'
Net::HTTP.version_1_2
def friendfeed_picture(feed_id)
Index: core/misc/lib/hikidoc.rb
===================================================================
--- core/misc/lib/hikidoc.rb (revision 3557)
+++ core/misc/lib/hikidoc.rb (working copy)
@@ -438,7 +438,7 @@
def compile_bracket_link(link)
if m = /\A(?>[^|\\]+|\\.)*\|/.match(link)
- title = m[0].chop
+ title = m[0].chop.gsub( %r[\\\|], '|' )
#!/usr/bin/ruby
require 'rubygems'
require 'rubytter'
require 'yaml'
require 'pit'
require 'pp'
def toCsv(friends)
open('friends.csv', 'w') do |f|
@charset "utf-8";
/*
Title: blue-on-pearl
Author: KAYA Satoshi
Access: <kayakaya@kayakaya.net>
License: GPL
Comment: 淡い黄色の背景に青文字を基調としたテーマ。日記本文は白地に黒。
vlayusuke(http://vlayusuke.com)のv-greengrassを元に作成しました。
#!/usr/bin/ruby
require 'rubygems'
require 'rubytter'
require 'yaml'
require 'pit'
require 'pp'
def to_yaml(users, filename)
users.to_yaml
#!/usr/bin/ruby
require 'rubygems'
require 'rubytter'
require 'yaml'
require 'pit'
require 'pp'
def to_csv(users)
open('friends.csv', 'w') do |f|
#
# 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