put it in the log in items in your user acct settings in your system preferences
Thanks, is this correct?
put it in the log in items in your user acct settings in your system preferences
Thanks, is this correct?
Im having trouble with the daily quote script...
curl http://encarta.msn.com/encnet/feeds/rssfeed.aspx?type=quote | grep description | sed 's/^[ \t]*//' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba
Can someone help? Thanks
Bad link ..![]()
Thanks for the script - works great.
How do i set a limit to the amount of content that is displayed?
<script-command> | head -10
<script-command> | sed 10q
ruby -r rss -e 'RSS::Parser.parse("https://www.macrumors.com/macrumors.xml").items.each {|item| puts "#{item.date.strftime("%H:%M")} #{item.title}"}'
19:31 Apple Looking to Revive 'Think Different' Advertising Campaign?
19:11 Apple Rolls Out Customizable Digital iTunes Gift Cards Via Facebook
18:00 AT&T Addressing Network Performance in Manhattan and San Francisco, High-Bandwidth Users
17:38 Ustream Offers Live Video Streaming for the iPhone
15:25 Analyst: Apple Prepping February Tablet Production Ramp Ahead of March or April Release
15:02 Apple Reportedly Preparing to Seed Builds of Mac OS X 10.6.3 to Developers
21:02 'Dragon Dictation' Brings Voice Transcription to the iPhone [Updated]
16:43 Google Releases Chrome for Mac Beta
...
Yeah thats what I was thinking....I was wondering if there might be a new link..??..
#!/usr/bin/ruby
require 'rss'
rss = RSS::Parser.parse 'http://www.britannica.com/feeds/qotd.rss'
puts rss.channel.title,""
rss.items.each do |item|
puts "#{item.description.sub(/<.*/m,'').strip} - #{item.title}"
end
ThanksThere is this post with one QOTD. That shows a lot of quotes.
I updated that code for Encyclopaedia Britannica - but that site does not have the quoter's name.
Code:#!/usr/bin/ruby require 'rss' rss = RSS::Parser.parse 'http://www.britannica.com/feeds/qotd.rss' puts rss.channel.title,"" rss.items.each do |item| puts "#{item.description.sub(/<.*/m,'').strip} - #{item.title}" end
Thanks for that site (though some of those don't work too well).some good ones here (working "top" in 10.6.2 etc)
Thanks, is this correct?
The GeekTool window will limit the output automatically... resize the window to get more or less lines.
But you can also filter the output through 'head' to limit the number of displayed lines (10 in this example):
Code:<script-command> | head -10
Or:
Code:<script-command> | sed 10q
By the way, I squeezed the rss-script into a oneliner:
Code:ruby -r rss -e 'RSS::Parser.parse("https://www.macrumors.com/macrumors.xml").items.each {|item| puts "#{item.date.strftime("%H:%M")} #{item.title}"}'
Gives:
Code:19:31 Apple Looking to Revive 'Think Different' Advertising Campaign? 19:11 Apple Rolls Out Customizable Digital iTunes Gift Cards Via Facebook 18:00 AT&T Addressing Network Performance in Manhattan and San Francisco, High-Bandwidth Users 17:38 Ustream Offers Live Video Streaming for the iPhone 15:25 Analyst: Apple Prepping February Tablet Production Ramp Ahead of March or April Release 15:02 Apple Reportedly Preparing to Seed Builds of Mac OS X 10.6.3 to Developers 21:02 'Dragon Dictation' Brings Voice Transcription to the iPhone [Updated] 16:43 Google Releases Chrome for Mac Beta ...
#!/usr/bin/ruby
require 'date'
(now, _, dd, _, _, dhm) = `uptime`.split(/ +|,/)
(dd, dh, dm) = dd.to_i, *dhm.split(':').map { |x| x.to_i }
puts "Uptime -------> #{dd} days, #{dh} hours, #{dm} minutes"
dh += (dm / 60.0)
dd += (dh / 24.0)
last = DateTime.parse(now) - dd
puts "Last Reboot --> #{last.day} #{Date::ABBR_MONTHNAMES[last.mon]} #{last.year} at #{last.hour}:#{last.min}"
Does anyone have a Geektool script for Battery percentage that works with Snow Leopard?
Thank you.
#!/bin/bash
asbreg=`ioreg -rc "AppleSmartBattery"`
maxcap=`echo "${asbreg}" | awk '/MaxCapacity/{print $3}'`;
curcap=`echo "${asbreg}" | awk '/CurrentCapacity/{print $3}'`;
prcnt=`echo "scale=2; 100*$curcap/$maxcap" | bc`;
printf "%1.0f%%" ${prcnt};
#EOF
Here's what I use (gives JUST the percentage):
Code:#!/bin/bash asbreg=`ioreg -rc "AppleSmartBattery"` maxcap=`echo "${asbreg}" | awk '/MaxCapacity/{print $3}'`; curcap=`echo "${asbreg}" | awk '/CurrentCapacity/{print $3}'`; prcnt=`echo "scale=2; 100*$curcap/$maxcap" | bc`; printf "%1.0f%%" ${prcnt}; #EOF
Not very elegant, but it gets the job done.
Thanks to everyone here! This has been a great lesson in very simple code writing. Here's what I managed to put together with all of your help.
you dont trust me ?...i thought we were a mac family?