• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 21:24
CET 03:24
KST 11:24
  • 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
ByuL: The Forgotten Master of ZvT28Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (Feb 16-22): MaxPax doubles0Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0258LiuLi Cup: 2025 Grand Finals (Feb 10-16)46Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2
StarCraft 2
General
Terran AddOns placement How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Nexon's StarCraft game could be FPS, led by UMS maker ByuL: The Forgotten Master of ZvT Oliveira Would Have Returned If EWC Continued
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament SEL Doubles (SC Evo Bimonthly) WardiTV Team League Season 10 RSL Season 4 announced for March-April
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 515 Together Forever Mutation # 514 Ulnar New Year Mutation # 513 Attrition Warfare
Brood War
General
Soma Explains: JD's Unrelenting Aggro vs FlaSh Recent recommended BW games TvZ is the most complete match up BGH Auto Balance -> http://bghmmr.eu/ ACS replaced by "ASL Season Open" - Starts 21/02
Tourneys
BWCL Season 64 Announcement The Casual Games of the Week Thread [Megathread] Daily Proleagues [LIVE] [S:21] ASL Season Open Day 1
Strategy
Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Simple Questions, Simple Answers Zealot bombing is no longer popular?
Other Games
General Games
Battle Aces/David Kim RTS Megathread Diablo 2 thread Nintendo Switch Thread Path of Exile Beyond All Reason
Dota 2
The Story of Wings Gaming 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 Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine UK Politics Mega-thread YouTube Thread Mexico's Drug War
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Inside the Communication of …
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2266 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 States13919 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
Next event in 6h 36m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 232
StarCraft: Brood War
Sea 5747
GuemChi 1603
Artosis 835
Shuttle 374
Moletrap 8
Dota 2
monkeys_forever623
NeuroSwarm76
League of Legends
JimRising 654
Counter-Strike
Fnx 2334
taco 710
Super Smash Bros
hungrybox2580
Mew2King15
Heroes of the Storm
Khaldor185
Other Games
summit1g12060
C9.Mang0410
Maynarde177
JuggernautJason25
Organizations
Other Games
gamesdonequick991
Counter-Strike
PGL126
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 469
• davetesta30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21809
League of Legends
• Doublelift4103
• Rush383
Upcoming Events
Replay Cast
6h 36m
Wardi Open
9h 36m
Monday Night Weeklies
14h 36m
Replay Cast
21h 36m
Replay Cast
2 days
Replay Cast
2 days
The PondCast
3 days
KCM Race Survival
3 days
Replay Cast
3 days
Ultimate Battle
4 days
Light vs ZerO
[ Show More ]
Replay Cast
4 days
CranKy Ducklings
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Acropolis #4 - TS5
PiG Sty Festival 7.0
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
Spring Cup 2026
WardiTV Winter 2026
Nations Cup 2026
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025

Upcoming

ASL Season 21: Qualifier #1
ASL Season 21: Qualifier #2
ASL Season 21
Acropolis #4 - TS6
Acropolis #4
IPSL Spring 2026
CSLAN 4
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
NationLESS Cup
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
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.