Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.
Hey Cap'n

Try these instead:
curl http://www.google.ca/finance?q=INDEXNASDAQ:.IXIC | sed -n '/MARKET DATA AND CHART/,/Open:/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '1,9d' | sed '4,9d' | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed 's/^/NASDAQ: /g'

curl http://www.google.ca/finance?q=INDEXDJX:.DJI| sed -n '/MARKET DATA AND CHART/,/Open:/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '1,9d' | sed '4,9d' | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed 's/^/DOW: /g'

curl http://www.google.ca/finance?q=INDEXSP:.INX | sed -n '/MARKET DATA AND CHART/,/Open:/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '1,9d' | sed '4,9d' | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed 's/^/S\&P 500: /g'

Wow, you are amazing! Those do work!:)

I wish I knew how to write the scripts myself, that way I could write down my whole portfolio, it would be amazing
 
Wow, you are amazing! Those do work!:)

I wish I knew how to write the scripts myself, that way I could write down my whole portfolio, it would be amazing

it's actually not that hard.

(though first, in all the codes, erase this bit "| sed '4,9d'" and add this bit at the end "| sed '2,9d' | sed 's/).*/)/g'". works better).

now, look up each of your stocks on google finance and replace the we address in your existing codes with the new one. then replace the title near he end. for example, if you own microsoft, you would change:

curl http://www.google.ca/finance?q=INDEXDJX:.DJI| sed -n '/MARKET DATA AND CHART/,/Open:/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '1,9d' | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed 's/^/DOW: /g' | sed '2,9d' | sed 's/).*/)/g'

to

curl http://www.google.ca/finance?q=NASDAQ%3AMSFT | sed -n '/MARKET DATA AND CHART/,/Open:/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed '1,9d' | sed '$!N;s/\n/ /'| sed '$!N;s/\n/ /' | sed 's/^/MSFT: /g' | sed '2,9d' | sed 's/).*/)/g'
 
@zzzzzz...

What is the code for "To Do List", and how does it work? Do it works with Calander?

Nah, I just have it as a plain text file that I append things to with Quicksilver. Adding stuff that wayis pretty handy, but to remove them I need to open the text file and edit it. Not ideal. (by the way, having a 'have done' list next to your 'to do' list it an awesome motivator, and you never have to remove things from the have done list; just set it up so that it only lists the last five or so things:
more /Users/XXXX/done.txt | sed -e '1p' -e :a -e '$q;N;5,$D;ba'
)

I could try to figure out how to make the list work with iCal, but I don't really use it. I used to use Lightning with Thunderbird, but the latest betas don't support it, so right now, just text files.
 
THUMBS UP
thats so hot :) thx for the code...i dont think there is a way to spread out the test from the left side of the screen to the right hand side as to pretty much create an artificial divider, is there?

not sure if i'm following, but try this:

cal | sed -e '/ 1 /s/ / /g' -e '/ 1 /!s/ / /g' | sed -e '/Su/s/^/ /g' -e 's/^/ /g' -e '/Su/!s/^/ /g'| sed -e '1d' -e '2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed -e 's/ 9 / 9 /g' -e 's/ 8 / 8 /g' | sed "s/^/ /;s/$/ /;s/ $(date +%e) /\|$(date +%e)\|/"

it might need to be slightly readjusted for the way the dates fall in april.
 
Just reworked mine a bit, decided to get everything I need into the bottom bar.

BTW, that's Bowtie, not GeekTool providing the iTunes artwork/info.

jW
 

Attachments

  • screen.jpg
    screen.jpg
    129.7 KB · Views: 1,394
Just reworked mine a bit, decided to get everything I need into the bottom bar.

BTW, that's Bowtie, not GeekTool providing the iTunes artwork/info.

jW

hi mal-
you gotta make the calendar left justified if you want the days to match the dates (it's not saturday).
 
Found that GeekTool crashes quite easily on my computer if I leave the Font box open and try to change to another shell.

That said, I am loving geektool so far. I just have the standard items listed in this thread so far.

Tried messing around with sorting out a colour scheme but when I was finished I think it is quite ugly so will be changing it around

What font is that? I believe it is the same as on the iPhone lock screen. I am new to GeekTool, and loving it so far!
 
Mine with facebook

I found this geektool thing here on macrumors, and like it a lot, so I'm posting my first creation. I forget where I found the background, but I like it. Its Prague's main train station.

Facebook was added using an Automator workflow and Geektool. By looking at the attached Automator Workflow image, and reading the scripts below.. it should be easy to piece together. When done, you can add facebook icon etc.. I found this from a flickr posting, so not my code

Geektool Shell: "Refreash" code:
Code:
Automator Runner ~/Documents/GetFaceBookFriendsStatus-ToTextFile.workflow
Be sure to adjust refreash time, otherwise the Automator workflow will run every 10 sec. :-(
I have mine set to 20 mins. ;)

Geektool Shell: "facebook" code:
Code:
head -n 300 ~/Documents/FriendStatus.txt | grep '[a-zA-Z]'

Geektool Shell: "facebook" code: EDIT.... If you like, this code adds the date and time stamp:
Code:
head -n 300 ~/Documents/FriendStatus.txt | grep '[a-zA-Z-0-9]'
 

Attachments

  • desktop.jpg
    desktop.jpg
    878 KB · Views: 1,584
  • Automator.png
    Automator.png
    60 KB · Views: 876
Can someone show me a script to get the weather information for Edmonton Canada? We don't have zip codes, so, I can't find a way to get the info from Weather Underground :(

I tried:

lynx -dump http://www.wunderground.com/global/stations/71123.html|awk ‘/Temp/{printf $2, “: “; for (i=3; i<=3; i++) printf $i ” ” }’


This will give me the info in terminal, but, just shows blank in Geektool.. Any help?
 
I don't know if something similar has already been posted. Here is a script for the 'ending' of the dates (1st, 2nd, 3rd etc.) I don't know what these are actually called :D This script returns the appropriate ending according to the date.

Code:
set dayvar to (get day of (current date)) as string

set ending to null as string

if dayvar ends with 1 and dayvar does not end with 11 then
	set ending to "st"
	
else if dayvar ends with 2 and dayvar does not end with 12 then
	set ending to "nd"
	
else if dayvar ends with 3 and dayvar does not end with 13 then
	set ending to "rd"
	
else
	set ending to "th"
	
	
end if
return ending
 
So i've been having fun with this and have spent about 3 hrs on it. I like the results but i really wish the weather would display city name but i have no skills to do this

My MR feed also seems flipped, i'd rather have the latest news at the top rather than bottom...any ideas on how to achieve this?

Finally these are my results thus far

PS. Thanks for everyone whose put codes up. You guys are awesome.
 

Attachments

  • Picture 3.jpg
    Picture 3.jpg
    346.1 KB · Views: 1,339
this should work better

curl http://m.wund.com/global/stations/71123.html | sed -e '/tr><td>Visibility<\/td>/q' | sed -e '1!G;h;$!d' | sed -e '/Temperature/q' -e '1d' | sed '/Conditions/,/Humidity/d' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' -e '/°/q' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed -e 's/°//g'


I actually got it perfectly with:

curl http://m.wund.com/global/stations/71123.html |sed -n '21p' | sed -e 's/<span class="nowrap"><b>//g' | sed -e 's/<\/b.*/C/g'

Thanks though!
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.