- 用 Firefox
- 安裝 VideoDownloader 擴充套件, 這樣你就不用辛苦在網頁原始碼找你想要下載的影音檔資訊, 它會幫你分析網頁找出可下載資料.
- 在 "DOWNLOAD LINK" 圖案上按右鍵 "鍵結另存新檔", 下載後記得更改檔案附加名為 ".flv"
- 可以用 VLC 或 FLV Player, 播放 flv 檔
- 轉檔 SUPER, Riva FLV Encoder 或 Total Video Converter


The wonderful Ruby/Rails world!
development:
adapter: mysql
database: tracks
host: localhost
username: root
password: pw
encoding: UTF8
test:
adapter: mysql
database: tracks
host: localhost
username: root
password: pw
encoding: UTF8
production:
adapter: mysql
database: tracks
host: localhost
username: root
password: pw
encoding: UTF8
$ cd $TRACKS
$ rake migrate
$ cd $TRACKS
$ ruby script/server -e production
~/cgi-bin
下, 新增 erb.cgi 檔案, 利用 erb 處理 rhtml 檔案, 內容: erb.cgi.txt$ chmod 755 ~/cgi-bin/erb.cgi
~/htdocs
, 新增 .htaccess 檔案, 告訴 apache 如何處理 rhtml 檔案Options ExecCGI FollowSymLinks
AddHandler rubypage .rhtml
Action rubypage /cgi-bin/erb.cgi
DirectoryIndex index.rhtml index.php index.html index.html.var
~/htdocs/index.rhtml,
index.rhtml.txt
require 'open-uri'
require 'rexml/document'
class Rss
attr_accessor :channel, :items
def initialize
@channel = @channel || {}
@items = []
end
def readit(url)
open(url) do |f|
#puts "#{f.content_type} #{f.charset}"
#puts f.read
d = REXML::Document.new(f.read)
#
d.elements.each("*/channel") do |e|
@channel["title"] = e.elements["title"].text
@channel["description"] = e.elements["description"].text
end
#
d.elements.each("*/item") do |e|
item = {}
item["title"] = e.elements["title"].text
item["link"] = e.elements["link"].text
@items << item
end
end
end
end
#
rss = Rss.new
rss.readit('http://www.mozilla.org/news.rdf')
puts rss.channel.inspect
rss.items.each do |i|
puts i.inspect
end
$ tar -xzf typo-2.6.0_with-rails.tgz
$ mv typo-2.6.0_with-rails typo
$ cd typo
login: &login
adapter: mysql
host: merriam.safesecureweb.com
username: ruby1727
password: pass
...
$ rm -rf vendor/rails
$ svn export http://dev.rubyonrails.org/svn/rails/tags/rel_1-0-0 vendor/rails
$ cd ~; mv htdocs htdocs-
$ ln -s ~/typo/public ~/htdocs
$ cd ~/dbi-0.1.0
$ ruby setup.rb config --with=dbi,dbd_pg
$ ruby setup.rb setup
$ ruby setup.rb install
require 'dbi'
# Same example, but a little more Ruby-ish
DBI.connect('DBI:Pg:we', 'postgresql', 'ssdbqazse') do |dbh|
dbh.select_all('SELECT COUNT(*) FROM "vParty"') do |row|
puts row
end
end
$ gem install rails --include-dependencies
$ gem install postgres-pr
require "rubygems"
require_gem "activerecord"
#db connection
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:database => "we",
:username => "postgresql",
:password => "ssdbqazse",
:encoding => "UTF8")
#ActiveRecord...
class Party < ActiveRecord::Base
set_table_name "\"Party\""
end
p = Party.find(:first)
puts p.inspect
$ gem install postgres-pr
development:
adapter: postgresql
database: we
username: postgres
password: yourpassword
encoding: UTF8
D:\workspace\mywe>ruby script/console
>>Loading development environment.
>>ActiveRecord::Base.connection
>>...
D:\workspace\mywe>ruby script/console
>>Loading development environment.
>>ActiveRecord::Base.find_by_sql "SELECT p.* FROM \"Party\" p"
>>...
D:\workspace\mywe>ruby script/console
>>Loading development environment.
>>
>>class Party < ActiveRecord::Base
>> set_table_name "\"Party\""
>>end
>>p = Party.find(:first)
>>...