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.
and as I said there would be a simple solution using sed to get JUST tomorrow from the entire list...

at the end of the code pulling the data add
Code:
 | sed -n '2p'

so it would look something like
Code:
usr/local/bin/icalBuddy -ic "YOUR CALENDAR NAME HERE" -iep "datetime,title" -ps "|	  |" -nc  -po "datetime,title" -df "%a" -nrd -b ""   eventsToday+3 | sed -n '2p'

what this is doing is piping it to sed and returning just line 2 (tomorrow)

cheers
edward
 
and as I said there would be a simple solution using sed to get JUST tomorrow from the entire list...

at the end of the code pulling the data add
Code:
 | sed -n '2p'

so it would look something like
Code:
usr/local/bin/icalBuddy -ic "YOUR CALENDAR NAME HERE" -iep "datetime,title" -ps "|	  |" -nc  -po "datetime,title" -df "%a" -nrd -b ""   eventsToday+3 | sed -n '2p'

what this is doing is piping it to sed and returning just line 2 (tomorrow)

cheers
edward

PERFECT! and i just changed the "2p" to "3p" to get ONLY the day after tomorrow and so on... awesome man, thanks so much!

since we are having fun with this, how about we try this....

how can we set it up where only the days show... so we would have an iCal script where the only output is "friday"
 
how can we set it up where only the days show... so we would have an iCal script where the only output is "friday"

I'm not sure I follow you on that one - what is the purpose? maybe that would help.

If you just want static text you could just use echo "friday"
 
I'm not sure I follow you on that one - what is the purpose? maybe that would help.

If you just want static text you could just use echo "friday"

well i suppose the point is to be able to create a more dynamic arrangement of the information, but im sure there is a simpler way of listing future days without iCal shenanigans
 
well i suppose the point is to be able to create a more dynamic arrangement of the information, but im sure there is a simpler way of listing future days without iCal shenanigans


give me an example of the use and i'll see what i can figure out
 
give me an example of the use and i'll see what i can figure out

i was hoping to stagger the DAY and the FORECAST sections of the geeklet....

so if there is some simple line of code, much like DATE +%a to get todays date, but for tomorrow and the day after... i could then remove the date segment from the iCal geeklet and use it from another line of code.... i will draw you a picture hold please


EDIT:

like this, i apologize for the bad layout of this.... it was a quick and dirty, these are all echos of plain text...

Picture1-4.png
 
you could get that layout utilizing the control you have in iCalbuddy

your divider between the date and title would be

Code:
-ps "|
   |"

so make that change and it will display as you have shown in the image
 
you could get that layout utilizing the control you have in iCalbuddy

your divider between the date and title would be

Code:
-ps "|
   |"

so make that change and it will display as you have shown in the image

they would be the same color though, i know i can do the ANSI color scheme but it doesnt give me the same adjustability of the colorwheel
 
they would be the same color though, i know i can do the ANSI color scheme but it doesnt give me the same adjustability of the colorwheel

seriously use the ansi color set up you can then specify anything you want - white doesn't actually *have* to be white when you specify the color white in the iCalbuddy config all it's doing is telling the output to add the escape code for white you can however change white in geektool to whatever color you want it to be this gives you quick simple flexibility to make changes easier when you decide to change your colors... you just go in and change the colors for those ansi color codes using the standard apple color picker.

Just so you see what I am saying here's a screen shot
 

Attachments

  • Screen shot 2010-01-21 at 3.39.16 PM.jpg
    Screen shot 2010-01-21 at 3.39.16 PM.jpg
    48.3 KB · Views: 3,450
seriously use the ansi color set up you can then specify anything you want - white doesn't actually *have* to be white when you specify the color white in the iCalbuddy config all it's doing is telling the output to add the escape code for white you can however change white in geektool to whatever color you want it to be this gives you quick simple flexibility to make changes easier when you decide to change your colors... you just go in and change the colors for those ansi color codes using the standard apple color picker.

Just so you see what I am saying here's a screen shot

got it, thanks a ton man, that looks perfect
 
i just googled an image of a polaroid, cut out the inside, added my photo, added the tape, rotated the images randomly and changed the little ID number at the bottom, i can give you my Photoshop file where you can just drop your photos in if you'd like

Thanks for the offer but I was playing around with geektool & look what i designed. I put photo borders and added a red tack,the only thing that's missing is the slight tilted angle but geektool does not allow me to. I used a .png file so that the tack can stand out & look real.

Picture1-2.png
 
and as I said there would be a simple solution using sed to get JUST tomorrow from the entire list...

at the end of the code pulling the data add
Code:
 | sed -n '2p'

so it would look something like
Code:
usr/local/bin/icalBuddy -ic "YOUR CALENDAR NAME HERE" -iep "datetime,title" -ps "|	  |" -nc  -po "datetime,title" -df "%a" -nrd -b ""   eventsToday+3 | sed -n '2p'

what this is doing is piping it to sed and returning just line 2 (tomorrow)

cheers
edward

Excellent addition to the weather scripts!
Thanks for the time and effort!

Woof, Woof - Dawg
pawprint.gif
 
Excellent addition to the weather scripts!
Thanks for the time and effort!

Woof, Woof - Dawg
pawprint.gif

Happy to contribute this has been the best resource I found so far and the group seems to actively contribute. sharing back is the least I could do.
 
Happy to contribute this has been the best resource I found so far and the group seems to actively contribute. sharing back is the least I could do.

Works great!

This is how I have incorporated your "tomorrow" forecast into my setup

It is a little different from the variations others have

geektool7.png



Woof, Woof - Dawg
pawprint.gif
 
Thanks for the offer but I was playing around with geektool & look what i designed. I put photo borders and added a red tack,the only thing that's missing is the slight tilted angle but geektool does not allow me to. I used a .png file so that the tack can stand out & look real.

Picture1-2.png

looks great man, way to make it your own! the turning of photos i had to do in PS because there is no rotation feature in geektool
 
update

icalbuddy has turned out to be the best tool possible when you use combined with subscriptions in ical I have birthdays from addressbook as well as subscribed to the facebook birthdays feed pipe it through uniq -q and it weeds out the duplicates but supplies the results from both sources as well as events I have and friends post on facebook so I know if they have anything coming up. Finally there is a subscription to a shared google calendar that me and my wife both can post to from our iphones calendar... this all is then displayed on the tv media center in a neat little package. Using icalbuddy's config file I have greater control over the final look of the output and also much more flexibility when I decide to change it.... it's a simple change in a single plist file.

latest screenshot
 

Attachments

  • Screen shot 2010-01-23 at 3.18.00 AM.jpg
    Screen shot 2010-01-23 at 3.18.00 AM.jpg
    96.6 KB · Views: 299
Can anyone tell me if there is a special script to use for CPU monitoring on a multi-core machine? I've been trying to use different scripts I've found, but none of them generate any more info than "idle."
 
minutes?

Oldish thread, but is there a way to modify:

#!/usr/bin/env ruby
# require 'date'
public
def to_seconds; self; end
def to_minutes; self/60.0; end
def to_hours; self/(60*60.0); end
def to_days; self/(60*60*24.0); end
def to_weeks; self/(60*60*24*7.0); end

def days; self * 60 * 60 * 24.0; end

date =`head /var/db/.TimeMachine.Results.plist | grep date| awk -F'<|>|T|:|Z' {'print $3 "-" $4'}`.chomp.split("-")

gap = (Time.local(Time.now.year,Time.now.month,Time.now.day,Time.now.hour) - Time.local(date[0].to_i,date[1].to_i,date[2].to_i,date[3].to_i) )
days = gap.to_days.to_i
hours = (gap - days.days).to_hours

if days > 14
puts "you gotta backup. its been #{days} days and #{hours} hours"

else
puts "#{hours} hours"

end



to show minutes as well (as hours)?

as in 5 hours 34 minutes
 
Here's my take on Twitter - RSS

After many attempts to use various feeds direct from their sources. I decided to look at a different approach. Be forewarned my code may not be beautiful but it does work.

so here goes... I start off by using twitters own built in search tool located at... http://search.twitter.com/advanced

This provides you with selectors to single out feeds as well as some other useful items such as the date to search within and even location (haven't tried location really yet)

so let's look at one of my feeds this is for CNN

Code:
Today=$(date '+%Y-%m-%d')
sinceDate=$Today
untilDate=$Today
TwitterUser=CNN
numPosts=10
curl --silent http://search.twitter.com/search.atom?q=+from%3A$TwitterUser+since%3A$sinceDate+until%3A$untilDate  | awk '/<title>/' | sed '1d' | sed  's/<content type="html">//' | sed 's/<\/content>//' | sed  's/^[[:space:]]*\(.*\)[[:space:]]*$/\1/' | sed  's@<\([^<>][^<>]*\)>\([^<>]*\)</\1>@\2@g' | sed  's/&lt\;.*a&gt\;//g' | sed  's/&//g' | sed  's/apos;//g'| sed  "$numPosts"q | sed  's|http://.*||'

I'll now attempt to break down what i have here

first we set some variables

The very first Today line sets todays date in the variable $Today in the format twitters advanced search uses to single out a date period.

The next 2 line sinceDate and untilDate set the range for what posts to pull from I have mine set to the variable set in the first line since I just want posts from TODAY you can set these to any other dates ahead or behind (note twitter only goes back about a week or 2 any further will fail to return anything.

The next line TwitterUser sets the twitter users feed to search for (you have to look it up before hand) In this case I'm using CNN

Last is numPosts this tells the script how many posts to return

The rest below isn't pretty and shouldn't require editing unless you know what you want to edit it for... Suffice it to say the rest is to pretty it up and remove the xml mess.

Here is a screen shot of what this produces you get 1 post per line

I'm sure it could be better code but it gets the job done... feel free to mod and enhance.
 

Attachments

  • Screen shot 2010-01-25 at 3.40.47 PM.jpg
    Screen shot 2010-01-25 at 3.40.47 PM.jpg
    61.5 KB · Views: 90
Expanding on the previous code Traffic Alerts

Here is a slight variation on the previous script using twitter feeds

This one scans twitter for local traffic alerts

Code:
Today=$(date '+%Y-%m-%d')
sinceDate=$Today
untilDate=$Today
TwitterUser=NYS_Traffic
numPosts=20
Terms="+holland+OR+turnpike+OR+lincoln"
curl --silent http://search.twitter.com/search.atom?q=$Terms+from%3A$TwitterUser+since%3A$sinceDate+until%3A$untilDate | awk '/<title>/' | sed '1d' | sed | sed 's/<content type="html">//'| sed 's/<\/content>//' | sed 's@<\([^<>][^<>]*\)>\([^<>]*\)</\1>@\2@g' | sed 's/&lt\;.*a&gt\;//g' | sed 's/&//g' | sed 's/apos;//g' | sed "$numPosts"q | sed 's|... Read more at||' | sed 's|http://.*||' | sed 's/Bridge  Tunnel Alert//' | sed 's/^[[:space:]]*\(.*\)[[:space:]]*$/\1/'


so much of the explination remains the same from the prior post with the addition of the variable $Terms

again I'm using TODAY as the date range limit (i don't care about yesterdays traffic and tomorrow isn't here yet...)

$TwitterUser is set to my areas traffic feed YMMV (pun intended)
$numPosts is how many to display at a time

with the addition of one new variable - this sets key words you want to have in the posts before adding them to the output. In my case I live around New York City / New Jersey area most often I am concerned with the tunnels, bridges and the NJ turnpike. so my search terms are : holland, turnpike, lincoln

the format for the variable is +holland+OR+turnpike+OR+lincoln

it MUST BE THAT WAY with the leading + and the +OR+ in between each item and NO ENDING + YES I KNOW i could have set them up in and array or something more friendly... I left it down and dirty for simplicity sake.

So in order for a post to be show in the output IT MUST CONTAIN at least ONE of those terms other than that I prob don't care.

I am fairly certain (HAVE NOT TESTED) you can swap +AND+ instead of +OR+ and this would require ALL the search terms to exist in the post. feel free to test that one out.

So now you begin to see the flexibility of this simple little script - ;) cheers!

here's a screen shot
 

Attachments

  • Screen shot 2010-01-25 at 4.18.59 PM.jpg
    Screen shot 2010-01-25 at 4.18.59 PM.jpg
    33.4 KB · Views: 88
Current Weather Conditions
Current%20weather%20Conditions.png
You'll need this script:
Code:
[B][I]curl --silent "http://weather.yahooapis.com/forecastrss?p=YOURCITYCODE&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' -e 's/, [0-9]* [A-Z]//' | tail -n1[/I][/B]

To get the Temperature,
Temperature.png
Use this script:
Code:
[B][I]curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0085&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1[/I][/B]

Please forgive my lack of skills but i cannot seem to get these into one script.

Any chance of getting the above as "Current weather condition comma Temperature" (example "Fair, -5 C") - like the one below, but with the infamous degree symbol?

I would be ever greatful! Thx a million! :)

Current Conditions - Celsius
Code:
curl "http://weather.yahooapis.com/forecastrss?p=NLXX0010&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
 
Please forgive my lack of skills but i cannot seem to get these into one script.

Any chance of getting the above as "Current weather condition comma Temperature" (example "Fair, -5 C") - like the one below, but with the infamous degree symbol?

I would be ever greatful! Thx a million! :)

Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0085&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1

Cheers!
 
Hey everyone,

Im new to Geektool and have been trying to create my own setup (below)!!

4305430594_f81de67afc.jpg


Larger size here:
http://farm3.static.flickr.com/2761/4305430594_f81de67afc.jpg

Sorry to disappoint, but its nothing new or fancy. I have never used a program like this and don't have a clue how to write my own scripts. I also plan on adding maybe the next and previous month's calendars, upcoming events from ical, and some itunes information.

Anyways, Im sorry if this has been commented on already, I have gone through most of the posts in this thread. I've been trying to figure out how to make one script box stay on top of another without interfering with my windows that are open (cause you can check the 'keep on top' box). Is there a way to regulate this???


Thanks,
BlizZ10
 
Hey everyone,

Im new to Geektool and have been trying to create my own setup (below)!!

Larger size here:
http://farm3.static.flickr.com/2761/4305430594_f81de67afc.jpg

Sorry to disappoint, but its nothing new or fancy. I have never used a program like this and don't have a clue how to write my own scripts. I also plan on adding maybe the next and previous month's calendars, upcoming events from ical, and some itunes information.

Anyways, Im sorry if this has been commented on already, I have gone through most of the posts in this thread. I've been trying to figure out how to make one script box stay on top of another without interfering with my windows that are open (cause you can check the 'keep on top' box). Is there a way to regulate this???


Thanks,
BlizZ10

If you are using Nerdtool all you do is drag the items in the list to change their layering order... I don't know how in Geektool - I prefer Nerdtool.
 
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX0085&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1

Cheers!

Youre the man!! Thank you! :D

conditiontempdegree.png


Minor detail, any chance of getting a space between the words when the condition description is more than one word, and if possible, no space between the temperature and the degree celsius...

This is what i mean: "Mostly(space)Cloudy,(space)-14°C"

Btw. current Oslo weather :S Its getting cold.

Thank you again! Youre the best!
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.