• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 01:29
CET 07:29
KST 15:29
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
BGE Stara Zagora 2026 announced11[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge2
StarCraft 2
General
BGE Stara Zagora 2026 announced SC: Evo Complete - Ranked Ladder OPEN ALPHA When will we find out if there are more tournament Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge
Tourneys
Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death
Brood War
General
BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ A cwal.gg Extension - Easily keep track of anyone Which season is the best in ASL? soO on: FanTaSy's Potential Return to StarCraft
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Nintendo Switch Thread The Perfect Game Stormgate/Frost Giant Megathread Beyond All Reason Should offensive tower rushing be viable in RTS games?
Dota 2
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Big Programming Thread Things Aren’t Peaceful in Palestine Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2741 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 3h 31m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft581
Nina 130
StarCraft: Brood War
Yoon 94
IntoTheRainbow 8
Dota 2
XaKoH 754
monkeys_forever555
NeuroSwarm176
Other Games
summit1g15003
Mew2King37
Organizations
Other Games
gamesdonequick1201
Dota 2
PGL Dota 2 - Main Stream268
StarCraft: Brood War
lovetv 13
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH177
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 26
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1407
Other Games
• Scarra1564
Upcoming Events
Sparkling Tuna Cup
3h 31m
NightMare vs YoungYakov
Krystianer vs Classic
ByuN vs Shameless
SKillous vs Percival
WardiTV Korean Royale
5h 31m
Zoun vs SHIN
TBD vs Reynor
TBD vs herO
Solar vs TBD
BSL 21
13h 31m
Hawk vs Kyrie
spx vs Cross
Replay Cast
17h 31m
Wardi Open
1d 5h
Monday Night Weeklies
1d 10h
StarCraft2.fi
1d 10h
Replay Cast
1d 17h
Wardi Open
2 days
StarCraft2.fi
2 days
[ Show More ]
PiGosaur Monday
2 days
Wardi Open
3 days
StarCraft2.fi
3 days
Replay Cast
3 days
The PondCast
4 days
Replay Cast
4 days
Korean StarCraft League
5 days
CranKy Ducklings
6 days
SC Evo League
6 days
BSL 21
6 days
Sziky vs OyAji
Gypsy vs eOnzErG
Liquipedia Results

Completed

SOOP Univ League 2025
RSL Revival: Season 3
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.