Forums Search Login Register
New Posts Todays Posts Find Users Posts Unanswered Threads Help Mark Forums as Read

Thread Options  Subscribe to this thread Subscribed Users  Add Reply 
Posts: 2,811
GeekTool Scripts using Ruby?

I was wondering if there is a possible way to make a geeklet able to scrape my monthly aggregate data meter, since Comcast has a 250GB cap I'd like to avoid going over it. (Really close this month)

According the the FAQ Comcast has about its bandwith cap, only 1% of users go over 250GB and that general users use roughly 4-6GB a month.

I call bull on that one, especially in this day and age. Even netflix uses roughly 0.7GB per hour of video, over 1GB if its in HD, not to mention data syncing services and steaming youtube/vimeo/soundcloud then theres misc file downloads, program trials, etc etc

But yeah I only have 7GB left til i hit my cap haha.

There is a Ruby script for it (

#!/usr/bin/env ruby

require 'rubygems'
require 'mechanize'


abort "Usage: #{$0} <username> <password>" unless ARGV.length == 2

agent =

agent.follow_meta_refresh = true
agent.redirect_ok = true
agent.user_agent = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6'

login_page = agent.get(URL_LOGIN)

login_form = login_page.form_with(:name => 'signin')
login_form.user = ARGV[0]
login_form.passwd = ARGV[1]

redirect_page = agent.submit(login_form)
redirect_form = redirect_page.form_with(:name => 'redir')

abort 'Error: Login failed' unless redirect_form

account_page = agent.submit(redirect_form, redirect_form.buttons.first)

users_page = agent.get(URL_USERS)
usage_text ="div[@class='usage-graph-legend']").first.content

puts usage_text.strip
However the script has no output to desktop, is there something i need to install? (ruby 1.8?)
08-02-2011, 11:58 AM
Subscribe to this thread Subscribed Users  Add Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Geektool and htop iclarindaboltona 1 399 06-29-2018 04:06 AM
Last Post: Monday12
  geektool in leopard thorhelicalremedial 0 217 02-05-2014 04:39 PM
Last Post: thorhelicalremedial
  Combining Fonts in OS X (Also Geektool Help?!) JerrieKasica 0 193 08-19-2013 04:52 AM
Last Post: JerrieKasica
  GeekTool Helper takes 17% CPU Bergerac 0 226 07-10-2013 06:17 AM
Last Post: Bergerac
  GeekTool: "Send to back" problem sbrantalvarmmoe 0 256 05-31-2013 02:33 AM
Last Post: sbrantalvarmmoe
  [Geektool] Geeklets lost off screen after migration Bakker 0 246 04-25-2013 12:11 PM
Last Post: Bakker
  I want to automatically disable wifi and geektool on battery? uleilarosariog 0 246 11-14-2012 07:25 PM
Last Post: uleilarosariog
  Geektool slowing down Mac/making it run hot lkeridunuuue 0 254 09-19-2012 07:53 AM
Last Post: lkeridunuuue
  Scripts Folder mw7smartc 0 127 07-10-2012 09:22 AM
Last Post: mw7smartc
  Geektool weather images wsusannahmccyyy 0 383 05-11-2012 12:23 PM
Last Post: wsusannahmccyyy

Forum Jump:

User(s) browsing this thread: 1 Guest(s)

Contact Us Privacy Policy Top RSS
Forum Software By: MyBB, © 2002-2018