What have you found for these years?

2009-11-15

estiah skills

updated: 2009-11-15 18:28
順便加上 wiki 的 link, 程式是:

html.css('.skill').select{|s| s.css('.c2 strong')}.map{|s|
title = s.css('.c2 strong').text
link = '<a href="http://estiah.aswt.net/index.php?title='
sprintf('%-20s %-15s %s',
title,
s.css('.percent').text.strip,
s.css('.rank').text.strip).
gsub((title == '' ? /\A\Z/ : title),
"#{link}#{title.gsub(' ','_')}\">#{title}</a>") }


要展示 skills 給別人看滿麻煩的.. 我討厭一直抓圖 @@
隨手寫了個 ruby script 印出來。就把原始檔存在
skills.html 裡,然後用 nokogiri 去 parse,
css selector 抓出想要的內容:
>> html = Nokogiri::HTML.parse(File.read('skills.html'))
>> puts html.css('.skill').select{|s| s.css('.c2 strong')}.
map{|s| sprintf('%-20s %-15s %s',
s.css('.c2 strong').text,
s.css('.percent').text.strip,
s.css('.rank').text.strip) }
Rank
Twin Blades mastered 2
Lightning mastered 2
Spear 156/180 2
Ward 142/180 2
Armor 139/180 2
Holy 87/180 2
Frost 49/180 2
Sword 22/180 2
Fire 18/180 2
Mace 13/180 2
Balance mastered 1
Empowerment mastered 1
Self Defense mastered 1
Tactician mastered 1
Heroism 80/100 1
Survival 78/100 1
Earth 49/100 1
Cheat Death 40/100 1
Sap 30/100 1
Leadership 29/100 1
Spirituality 24/100 1
Quickness 20/100 1
Fist Weapons 17/100 1
Burst 15/100 1
Shadow 14/100 1
Destruction 6/100 1
Defender 3/100 1
Axe 1/100 1
Rank
Animal Friendship 24/220 3
Horse Riding mastered 2
Animal Tamer 70/180 2
Animal Raising 80/100 1
Mentoring 36/100 1
Shop Management 18/100 1
First Aid 7/100 1
Appraisal 6/100 1
Bargain 6/100 1
Rank
Herbalist 108/180 2
Condenser 72/180 2
Miner 36/180 2
Extreme Condenser 24/180 2
Logger 24/180 2
Treasure Hunter mastered 1
Explorer 96/100 1
Extreme Logger 44/100 1
Extreme Miner 40/100 1
Extreme Herbalist 24/100 1
Rank
Sewer Cleaner mastered 1
Spirit Appeaser 24/100 1
Element Soother 18/100 1
Golem Crusher 10/100 1
Pumpkin Delice 5/100 1

0 retries:

Post a Comment

All texts are licensed under CC Attribution 3.0