• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:50
CEST 12:50
KST 19:50
  • 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
TL.net Map Contest #21: Voting4[ASL20] Ro4 Preview: Descent10Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 6-12): Four star herO65.0.15 Patch Balance Hotfix (2025-10-8)72Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition325.0.15 Balance Patch Notes (Live version)119
StarCraft 2
General
TL.net Map Contest #21: Voting 5.0.15 Patch Balance Hotfix (2025-10-8) Ladder Impersonation (only maybe) The New Patch Killed Mech! Weekly Cups (Oct 6-12): Four star herO
Tourneys
Master Swan Open (Global Bronze-Master 2) Tenacious Turtle Tussle WardiTV Mondays SC2's Safe House 2 - October 18 & 19 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
[ASL20] Ro4 Preview: Descent BW caster Sayle ASL20 General Discussion BW General Discussion BSL Season 21
Tourneys
[ASL20] Semifinal B [ASL20] Semifinal A [Megathread] Daily Proleagues [ASL20] Ro8 Day 4
Strategy
Current Meta BW - ajfirecracker Strategy & Training Siegecraft - a new perspective TvZ Theorycraft - Improving on State of the Art
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Inbreeding: Why Do We Do It…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 950 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 12h 10m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 195
Rex 28
StarCraft: Brood War
Sea 3607
Calm 2890
Rain 1694
Horang2 945
actioN 737
Flash 681
Leta 651
Soma 455
BeSt 439
Zeus 272
[ Show more ]
Stork 271
Hyun 222
EffOrt 171
hero 137
Last 125
PianO 109
Killer 88
Pusan 77
ToSsGirL 73
ggaemo 66
Sharp 64
ZerO 59
Mind 52
Light 38
Shinee 28
Barracks 26
Rush 23
Movie 22
soO 21
JulyZerg 16
Sacsri 14
Bale 7
HiyA 5
Dota 2
XcaliburYe252
League of Legends
JimRising 457
Other Games
singsing1707
olofmeister1074
ceh9627
Pyrionflax241
crisheroes212
DeMusliM200
Fuzer 60
Mew2King28
B2W.Neo13
ZerO(Twitch)11
Organizations
Counter-Strike
PGL4171
Other Games
gamesdonequick770
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• LUISG 32
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1997
• Lourlo511
Upcoming Events
OSC
12h 10m
The PondCast
23h 10m
OSC
1d 1h
Wardi Open
2 days
CranKy Ducklings
2 days
Safe House 2
3 days
Sparkling Tuna Cup
3 days
Safe House 2
4 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 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.