Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > using AppleScript to get complete weather

using AppleScript to get complete weather
Thread Tools
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Dec 11, 2004, 06:33 PM
 
so, i found this here SOAP thingy. right here ... It is called USA Weather Forecast...

and I want it to get the current condition (cloudy, raining, sunny, etc.) and the temp in Fahrenheit... can someone help me please?
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 12, 2004, 12:19 PM
 
That WebService is implemented in .NET - I don't think that .NET is SOAP compliant.
You know it makes sense. ☼ ☼ ☼ Growl.
     
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Dec 12, 2004, 12:30 PM
 
oh, ohkay,
thank you


see, I am currently getting the weather by parsing a weather.gov website, but the thing is the URL for that is not based on just a zipcode, so customizing it is not easy... but it is a pretty sweet script, but fat and hard to customize. It is a applescript studio app that you can just use different scripts to change what the image on the background is. This is the Weather script:
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 12, 2004, 12:55 PM
 
you could try this one:

http://www.xmethods.net/ve2/ViewList...0-6C2DBE1685F8



Code:
---- Main script ---------------------------------------- set myZip to 90210 display dialog getTemperature(myZip) -- This handler makes the SOAP request. on getTemperature(zipCode) set methodName to "getTemp" set namespace to "urn:xmethods-Temperature" set SOAPAction to "" tell application "http://services.xmethods.net:80/soap/servlet/rpcrouter" return call soap ¬ {method name:methodName, method namespace uri:namespace, parameters:{sourcedata:zipCode as string} ¬ , SOAPAction:SOAPAction} end tell end getTemperature
You know it makes sense. ☼ ☼ ☼ Growl.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 12, 2004, 05:03 PM
 
Here's another version of the script that uses growl to show the temperature. (and more detailed aviation meterology )

Code:
---- Main script ---------------------------------------- set heathrow to "LHR" set localWeather to getWeather(heathrow) --Format the weather set the NoteTitle to |name| of station of localWeather set theDescription to |string| of sky of localWeather & " :temperature: " & |string| of temperature of localWeather --Display a Notification try tell application "GrowlHelperApp" set myAllNotesList to {"tempNote"} register as application "SOAPTemperature" all notifications myAllNotesList default notifications {"tempNote"} icon of application "Script Editor" notify with name "tempNote" title NoteTitle description theDescription application name "SOAPTemperature" end tell on error display dialog (noteTitle & " : " & theDescription) end -- This handler makes the SOAP request. on getWeather(airportCode) set methodName to "getWeatherReport" set namespace to "capeconnect:GlobalWeather:GlobalWeather" set mySOAPAction to "capeconnect:GlobalWeather:GlobalWeather#getWeatherReport" tell application "http://live.capescience.com:80/ccx/GlobalWeather" return call soap ¬ {method name:methodName, method namespace uri:namespace, parameters:{sourcedata:airportCode as string} ¬ , SOAPAction:mySOAPAction} end tell end getWeather
(Last edited by Diggory Laycock; Dec 12, 2004 at 05:46 PM. )
You know it makes sense. ☼ ☼ ☼ Growl.
     
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
Dec 12, 2004, 08:06 PM
 
wait, what is that "description of sky thing" ?


....
oh


sweet, thanks!
(Last edited by Nebagakid; Dec 12, 2004 at 08:45 PM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:10 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2