• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:45
CEST 18:45
KST 01:45
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Balance hotfix patch 5.0.16b (July 16)52Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!5Weekly Cups (July 6 - 12): Protoss strike back12BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) [D] Wireframe Casting Removed Clem: "I don't have that much hope in Blizzard" Reynor: GSL Loss Wasn't About Preparation Format Is the larve respawn broken?
Tourneys
Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
ASL22 General Discussion NaDa’s Body Followup BW General Discussion Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) Etiquete rules in Asl?
Tourneys
[Megathread] Daily Proleagues Escore Tournament - Season 3 Small VOD Thread 2.0 [IPSL] Spring 2026 Grand Finals - This Weekend!
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
Nintendo Switch Thread Path of Exile General RTS Discussion Thread Beyond All Reason Stormgate/Frost Giant Megathread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Games Industry And ATVI UK Politics Mega-thread YouTube Thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Req][Books] Good Fantasy/SciFi books Series you have seen recently...
Sports
2024 - 2026 Football Thread MLB/Baseball 2023 McBoner: A hockey love story Tennis[sport] Formula 1 Discussion
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Poker (part 2)
Nebuchad
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7709 users

fun little ruby script

Blogs > spitball
Post a Reply
spitball
Profile Blog Joined August 2008
Australia81 Posts
Last Edited: 2009-08-11 19:03:31
August 11 2009 17:45 GMT
#1
not sure if the formatting will be off... anyway, i decided to try some ruby. the code is a bit hackish but i think its pretty cool what you can do with a few lines


require 'rubygems'
require 'hpricot'
require 'open-uri'

forum = Hpricot(open("http://www.teamliquid.net/forum/index.php?show_part=0"))
lasturl = forum.search("a[@title*=Jump to the last page]").at("[@href*=/forum/viewmessage.php?topic_id=32696]")['href']
page = Hpricot(open("http://www.teamliquid.net" + lasturl))
status = page.search("td.forumPost").last().inner_html.gsub(/<br[^>]*>/, "\n").gsub(/<\/?[^>]*>/, "").gsub(/\t*/, "").gsub(/\n{2,}/, "\n")
`xsetroot -name "#{status.split("\n")[0]}"`


edit: I might try and come up with something with an interface (and something that's actually useful! )

**
illu
Profile Blog Joined December 2008
Canada2531 Posts
August 11 2009 17:52 GMT
#2
I am not going to look at it until you describe what your code does.
:]
GreEny K
Profile Joined February 2008
Germany7312 Posts
August 11 2009 17:55 GMT
#3
Yeah whats it supposed to do? Might want to add that in somewhere otherwise people will get paranoid lol
Why would you ever choose failure, when success is an option.
spitball
Profile Blog Joined August 2008
Australia81 Posts
August 11 2009 18:01 GMT
#4
Check out where that URL leads

and then...
page.search("td.forumPost").last()
foeffa
Profile Blog Joined August 2007
Belgium2115 Posts
August 11 2009 18:15 GMT
#5
Haha. Yeah that is one of the best threads on the forum. ^_^
觀過斯知仁矣.
shmay
Profile Blog Joined July 2004
United States1091 Posts
Last Edited: 2009-08-11 18:47:44
August 11 2009 18:43 GMT
#6
what was the point of this script?

what exactly is xsetroot supposed to do?
spitball
Profile Blog Joined August 2008
Australia81 Posts
August 11 2009 18:51 GMT
#7
that sets the name of the root window (for me it sets the text on a little status bar kinda thing on my desktop).
StorrZerg
Profile Blog Joined February 2008
United States13921 Posts
August 11 2009 18:51 GMT
#8
how do you make it work O_o?
Hwaseung Oz fan for life. Swing out, always swing out.
shmay
Profile Blog Joined July 2004
United States1091 Posts
August 11 2009 18:53 GMT
#9
didn't seem to work on my mac
shmay
Profile Blog Joined July 2004
United States1091 Posts
August 11 2009 18:56 GMT
#10
http://www.teamliquid.net/forum/viewmessage.php?topic_id=32696&currentpage=172

it just parses the html from the last post on that page.
coltrane
Profile Blog Joined June 2008
Chile988 Posts
August 11 2009 19:16 GMT
#11
aaahahha ruby is great

Yes is amazing what you can do with few lines.
Jävla skit
spitball
Profile Blog Joined August 2008
Australia81 Posts
August 11 2009 19:52 GMT
#12
On August 12 2009 04:16 coltrane wrote:
aaahahha ruby is great

Yes is amazing what you can do with few lines.

Yep, although I should point out that Hpricot is really cool and does most of the work in this instance
omgbnetsux
Profile Blog Joined April 2004
United States3749 Posts
August 11 2009 20:07 GMT
#13
<3 Ruby. Its one of the few languages I code in purely for fun.
Please log in or register to reply.
Live Events Refresh
WardiTV Invitational
16:00
Replay Cast for D/A/CH
TaKeTV 335
IPSL
16:00
3rd Place
Dragon vs Hawk
LiquipediaDiscussion
PSISTORM Gaming Misc
15:55
FSL TeamLeaguePlayoffs STvsASH
Freeedom26
Liquipedia
Epic.LAN
13:00
Epic.LAN 48 Playoff Stage
epiclan70
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko690
CosmosSc2 78
RushiSC 48
StarCraft: Brood War
Calm 4504
Rain 1989
Britney 1225
Shuttle 1050
Horang2 417
Mini 377
ggaemo 347
Stork 295
BeSt 224
Sharp 86
[ Show more ]
Movie 84
Killer 37
Barracks 37
Shine 23
ToSsGirL 22
Hm[arnc] 20
Rock 18
yabsab 17
IntoTheRainbow 16
Terrorterran 15
Yoon 12
HiyA 10
Purpose 7
ajuk12(nOOB) 5
Dota 2
Gorgc7648
qojqva545
LuMiX1
League of Legends
Doublelift3543
KnowMe32
Counter-Strike
fl0m1390
kRYSTAL_66
edward53
Heroes of the Storm
MindelVK26
Other Games
Liquid`RaSZi839
Beastyqt306
DeMusliM271
Hui .203
byalli186
XaKoH 112
Livibee96
C9.Mang055
Grubby0
Organizations
Other Games
gamesdonequick2135
BasetradeTV193
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• OhrlRock 1
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• Airneanach43
• Pr0nogo 4
• 80smullet 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Jankos2361
• TFBlade736
Other Games
• Shiphtur299
Upcoming Events
RSL Revival
16h 15m
Classic vs Trap
herO vs SHIN
Sparkling Tuna Cup
17h 15m
OSC
20h 15m
IPSL
23h 15m
Bonyth vs Ret
WardiTV Weekly
1d 18h
Monday Night Weeklies
1d 23h
OSC
2 days
PiGosaur Cup
3 days
The PondCast
3 days
Replay Cast
4 days
[ Show More ]
CrankTV Team League
4 days
Replay Cast
5 days
CrankTV Team League
5 days
Korean StarCraft League
6 days
RSL Revival
6 days
Online Event
6 days
Liquipedia Results

Completed

Escore Tournament S3: W3
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
YSL S3
CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.