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.
so this is my weather script:


curl --silent "http://xml.weather.yahoo.com/forecastrss?p=30339&u=f" | grep -e "Current Conditions" -A 1 | tail -n 1 | sed -e 's/<BR \/>//' && echo && curl --silent "http://xml.weather.yahoo.com/forecastrss?p=30339&u=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/High\:\ \(.*\)\ Low\:\ \(.*\)/\?H\: \1\ L\:\ \2/" | sed "s/\?\(.*\)/\\1/"


But the problem is it shows today and tomorrow, can i make it show today, tomorrow, and the day after tomorrow? How would i edit the code to keep adding days? maybe even up to 5 days?

thanks in advance
 
so this is my weather script:


curl --silent "http://xml.weather.yahoo.com/forecastrss?p=30339&u=f" | grep -e "Current Conditions" -A 1 | tail -n 1 | sed -e 's/<BR \/>//' && echo && curl --silent "http://xml.weather.yahoo.com/forecastrss?p=30339&u=f" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\)\.\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/High\:\ \(.*\)\ Low\:\ \(.*\)/\?H\: \1\ L\:\ \2/" | sed "s/\?\(.*\)/\\1/"


But the problem is it shows today and tomorrow, can i make it show today, tomorrow, and the day after tomorrow? How would i edit the code to keep adding days? maybe even up to 5 days?

thanks in advance

i think the -2 after forcast is what s needed to be changed, not sure
 
allright, thanks RogersDA. I have a solution based on your comment.

geektool runs the data collection part of the script, and everytime i want to look at the graphs, i run the image generation part.

so thanks

Why don't you just put the whole thing into a crontab, then geektools only needs to know the location of the images.
 
i think the -2 after forcast is what s needed to be changed, not sure

i thought that was right and kept changing it but got nothing from it... some gave me only today, others just broke the code all together.

thanks for your help though, anyone else
 
might try changing what ever changed the code to just today? idk, just pulling ideas :p

yeah that was the -2... i changed it to a bunch of different numbers but nothin worked, i dont kow what any of the numbers / letters / symbols mean
 
has anyone got something that will give me the 'th' 'st' or 'rd' for the date?

i tried searching (which was very difficult for this particular thing i found out since i don't know what they're called) and found something in this thread which didn't work
 
Does anyone have a script to show the time remaining on a battery charge?
I have the percentage remaining, but would also like the "time remaining"
 
Does anyone have a script to show the time remaining on a battery charge?
I have the percentage remaining, but would also like the "time remaining"

HI Jatlas,

enter this code in terminal and you'll get the remaining time in minutes

Code:
 ioreg -rc \"AppleSmartBattery\" | awk '/AvgTimeToEmpty/{print $3}'

I'm was busy with transforming the minutes too hours... but this will be done in applescript because I don't know unix that well.
this is the conversion from minutes to hours like in your menubar

Code:
 tell application "Finder"
	
	set min to do shell script "ioreg -rc \"AppleSmartBattery\" | awk '/TimeRemaining/{print $3}'"
	set h to character 1 of ((min / 60) as string)
	set m to (min - (60 * h)) as string
	if (count of every character of m) = 1 then
		set m to "0" & m
	end if
	return ((h & ":" & m) as string)
	
end tell

all you have to do is copy and paste into "applescript editor" (every mac has it) and save as .scpt
go to geektool> new shell geeklet > type following " osascript /Users/yourname/path to the script.scpt"
PS. path is case sensitive

Tomorrow, ill try to make it as a shell script if your prefer ;-)
Hope this is what you're looking for
 
Hey guys, inspired by a picture off lifehacker, I decided to totally redo my geektool layout. Thought I'd share. I'm including the before and after. If you get a chance let me know if you think it's an improvement or not.

Also, feel free to ask for any of the scripts. In case anyone's interested, I figured out a way to make stock quotes appear in red if they gone down and green if they've gone up - but didn't include it in this screenshot.

The google script for stock quotes is not working for me... Any opinions on why it could be so..?
 
Anyone know how to made script for get seconds,minutes, or days left to 2011 ?

that would be great :D
 
Jon-Luke nice setup ;-)
but there is something wrong with you calendars XD
you'll see after December 2009 come january 2010 and not january 2009

just a small thing you've missed ;-)

I've been trying to figure out how to fix this... It fixed itself now that it is 2010, I'm wondering if anyone has any ideas on where I may have gone wrong...
 
One thing thats bothering me, is there a way to center things on the desktop? Cause my OCD is eating away at my patience.


I actually cant tell if its Geektool or Adium thats not entered...
 

Attachments

  • Screen shot 2010-01-01 at 2.27.42 AM.png
    Screen shot 2010-01-01 at 2.27.42 AM.png
    585.1 KB · Views: 411
Is anyone else having the problems with the simple code for the date not recognizing that the year has changed?

Code:
date +%G
 
Here's my new desktop for January 2010 I like the minimal look.
If you want to know how to put the month like "jan" instead of "january"
just put the code in lower case i found this out on my own.

desktop30.png
 
Is anyone else having the problems with the simple code for the date not recognizing that the year has changed?

Code:
date +%G

%G --> year of the current ISO week number

%V --> Current ISO Week number

ISO Weeks & ISO years are a bit different.

I believe that we are nearing the end of the 53rd ISO week - which happens to be still in the ISO year of 2009. Monday January 4th starts the first week (ISO Week 1) of 2010 (ISO Year).
 
has anyone got something that will give me the 'th' 'st' or 'rd' for the date?

i tried searching (which was very difficult for this particular thing i found out since i don't know what they're called) and found something in this thread which didn't work
Ordinal Dates:

I created a php script as follows:
Code:
<?php
date_default_timezone_set('America/New_York');
echo date('jS');
?>
Your time zone setting may be different. Then, using Mac's text editor (making sure you use Format - Make Plain Text) save this script as ordinal_date.php

I saved the file to /var/tmp (that's where I keep all my geektools scripts/files/images).

In Geektools create a shell script that runs the above php script.
Code:
php /var/tmp/ordinal_date.php

The above will output just the day (1st, 2nd, 3rd, etc.).

Replace the 2nd echo line above with
Code:
echo date('l F jS\, Y');
to get something like: Friday January 1st, 2010.
 
My weather forecast image has not been updating like it should and I don't know why.

The last retrieved image is still being shown, so the issue is with the curl code and pulling it from the site.

Solutions?

Code:
curl --silent "http://weather.yahoo.com/united-states/illinois/-12784087/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /var/tmp/weather_test.pngxargs curl --silent -o /var/tmp/weather.png


SOLUTION - maybe

Using Post 1470 as a guide, I got it working...I think. I should know sooner than later.
 
curl http://www.google.ca/finance?q=INDEXDJX:.DJI | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/DOW: /g'

curl http://www.google.ca/finance?q=INDEXNASDAQ:.IXIC | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/NASDAQ: /g'

curl http://www.google.ca/finance?q=INDEXSP:.INX | sed -n '/price-panel style/,/ Close/p' | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'| sed '/^$/d' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | head -1 | sed 's/^/SP 500: /g'


these are my geektool scripts for finance does anyone know how to get them to go red when their at a loss and green when their at a gain.
 
Geektool desktop 2010

My new Geektool :apple: desktop - with the help of everyone in the forum (kudos!)
 

Attachments

  • Geektop Desktop - January 2010_800x500.shkl.png
    Geektop Desktop - January 2010_800x500.shkl.png
    650.3 KB · Views: 516
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.