Skip to content

Instantly share code, notes, and snippets.

@siuying
siuying / x
Created October 23, 2008 11:49
function cmd_hello_world() {
displayMessage("Hello, World! yo.");
}
@siuying
siuying / gist:77262
Created March 11, 2009 02:35
find my twitter first follows first follows first ...
require 'yaml'
require 'twitter'
require 'graphviz'
config = YAML.load_file('twitter.yml')
twit = Twitter::Base.new(config['username'], config['password'])
user_name = config['username']
def load_user(twit, user_name)
@siuying
siuying / x
Created March 30, 2009 23:14
List your recent bookmarks on delicious.com
var cookie_mgr = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager);
CmdUtils.CreateCommand({
name: 'digest',
icon: 'http://delicious.com/favicon.ico',
description: 'List your recent bookmarks on delicious.com, optionally specify a tag',
help: 'digest <tags>',
CmdUtils.CreateCommand({
name: 'pastie',
description: 'paste selected text to pastie',
help: 'pastie',
homepage: 'http://www.reality.hk',
author: {
// ==UserScript==
// @name FBQuizMuter
// @namespace hk.reality
// @description Mute those quiz!
// @include http://www.facebook.com/home.php*
// @include http://www.facebook.com/profile.php*
// ==/UserScript==
// Add jQuery
var $;
# scRUBYt script that parse tvb scheule and return XML
# Sample Output: http://gist.github.com/120827
#
require 'rubygems'
require 'scrubyt'
tvb = Scrubyt::Extractor.define do
fetch "http://schedule.tvb.com/j2/20090531.html?category=all"
<root>
<schedule>
<program>
<time>06:00 am</time>
<name>360˚音樂無邊</name>
</program>
<program>
<time>07:00 am</time>
<name>世界正美麗 III</name>
</program>
@siuying
siuying / gist:120862
Created May 31, 2009 11:53
Retrieve Latest Links From Popgo, scRUBYt style
# Retrieve Latest Links From Popgo, scRUBYt style
# Sample Output: http://gist.github.com/120864
require 'rubygems'
require 'scrubyt'
require 'iconv'
popgo = Scrubyt::Extractor.define do
fetch 'http://bt.popgo.net/'
<root>
  <torrents>
    <file>
      <details>
        <name>[漫游字幕组] CROSS_GAME 幸运四叶草 第09话 RMVB</name>
        <url>
          <link>
            <info>http://bt.popgo.net//stats/stats_be45e18e49a4cef899376af3d35936cde8fe1208.html</info>
            <download>http://bt.popgo.net/down/down.php?hash=be45e18e49a4cef899376af3d35936cde8fe1208</download>
          </link>
require 'rubygems'
require 'scrubyt'
require 'iconv'
# Fetch the seatplan for the schedule
movies = Scrubyt::Extractor.define do
# use a proper schedule link here
fetch "http://www2.cinema.com.hk/revamp/html/show_seat.php?lang=c&show_id=13105241"
# schedule info