a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by Cedar
Cedar  ·  3288 days ago  ·  link  ·    ·  parent  ·  post: Hubski Newsletter #050

Here it is, I call it with "ruby hubski.rb URL" where the URL is the Hubski list.

----

  require 'nokogiri'

require 'open-uri'

hubski = Nokogiri::HTML(open(ARGV[0]))

users = hubski.css("#username")

puts "

[View as a list](#{ARGV[0]})

[Sign up here](http://hubskinewsletter.com)

Thanks @insomniasexx@!

Shout-outs:

"

users.map(&:text).uniq.each do |user|

print "@#{user}@ "

end





randomuser  ·  3288 days ago  ·  link  ·  

NIce.

demure  ·  3288 days ago  ·  link  ·  

that's handy. I should learn Ruby.

Cedar  ·  3288 days ago  ·  link  ·  

It's a nice language, coming primarily from Java I really appreciate the brevity of it. Ruby (and Rails especially) has the tendency to do a lot of stuff auto-magically which is a blessing and a curse. I painstakingly typed that script up on my Raspberry Pi over SSH from my mobile :D

demure  ·  3288 days ago  ·  link  ·  

ouch!! sftp not an option for you? or were you just eager to do this while on the move somewhere?

Cedar  ·  3288 days ago  ·  link  ·  

I'm running my Pi headless, so all my interaction with it has been through SSH. Just my computer is out of action so only got my phone to play with!

demure  ·  3287 days ago  ·  link  ·  

I see.