 |
 |
using AppleScript to get complete weather
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status:
Offline
|
|
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
|
|
That WebService is implemented in .NET - I don't think that .NET is SOAP compliant.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status:
Offline
|
|
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
|
|
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
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
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.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status:
Offline
|
|
wait, what is that "description of sky thing" ?
....
oh
sweet, thanks!
(Last edited by Nebagakid; Dec 12, 2004 at 08:45 PM.
)
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|