Re: Re: Can I make this work without using Internet Explorer...
Re: Re: Can I make this work without using Internet Explorer...
- Subject: Re: Re: Can I make this work without using Internet Explorer...
- From: Paulo Jorge Rodrigues Góis <email@hidden>
- Date: Thu, 28 Feb 2002 23:16:43 +0000
Recebi de JJ, no dia 2002/02/28 17:45, desde email@hidden, o seguinte:
>
You can d/l this url ("http://apps.wolffm.com/playwindow2.php") using URL
>
Access Scripting to "Temporary Items", then reading the >title< tag.
>
You should obtain the entire song title...
>
>
JJ
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
I have managed to be able to download the file to the temporary items folder
and even to open it. But I don't know how to make the script get the title
of the html file. Or I could open the file as text to search the title of
the music in it...
Thank you for your time
Good luck...
P.S. Here it is...
property required_version : "2.0.3"
try
tell application "iTunes"
-- VERSION CHECK
set this_version to the version as string
if this_version is not greater than or equal to the required_version
then
beep
display dialog "This script requires iTunes version: " &
required_version & ,
return & return & ,
"Current version of iTunes: " & this_version buttons
{"Update", "Cancel"} default button 2 with icon 2
if the button returned of the result is "Update" then
my access_website("
http://www.apple.com/itunes/download/")
return "incorrect version"
end if
end if
-- get the title of the web page
set the item_name to "playwindow2.php"
set the parent_directory to "
http://apps.wolffm.com/"
set this_URL to (the parent_directory & the item_name)
set the local_filepath to ((path to temporary items folder as text)
& "wolf-fm.html")
set the timeout_amount to 60
try
with timeout of timeout_amount seconds
tell application "URL Access Scripting"
download this_URL to file local_filepath replacing yes
with progress
end tell
end timeout
on error error_message number error_number
if the error_number is not -128 then
tell application "iTunes"
activate
beep
display dialog ("Error number: " & (error_number as
text) & ,
return & return & ,
error_message) buttons {"Cancel"} default button 1
giving up after 15
end tell
end if
end try
set the song_info to (characters 10 thru end of the theTitle) as
string
set search_string to "-"
set string_location to the offset of search_string in song_info
set the song_artist to (characters 1 thru (string_location - 2) of
the song_info) as string
set the song_title to (characters from (string_location + 2) to -1
of the song_info) as string
-- set the id3 of the Wolf-FM streming to IE window information
tell source "library"
tell playlist "My Radios"
try
set the name of (every track whose comment is "The
Hottest mix of the '70s, '80s and today") to "Wolf-fm now plaiyng: " &
song_title
set the artist of (every track whose comment is "The
Hottest mix of the '70s, '80s and today") to song_artist
on error
display dialog "The Wolf-FM radio station was not
found." buttons {"Cancel"} default button 1 giving up after 15
end try
end tell
end tell
end tell
tell application "iTunes" to activate
on error error_message number error_number
if the error_number is not -128 then
tell application "iTunes"
activate
beep
display dialog ("Error number: " & (error_number as text) & ,
return & return & ,
error_message) buttons {"Cancel"} default button 1 giving up
after 15
end tell
end if
end try
on access_website(this_URL)
ignoring application responses
tell application "Finder"
open location this_URL
end tell
end ignoring
end access_website
--
Paulo Jorge Rodrigues Gsis
R. Antsnio A. Machado n: 24, 5: Fte.
1600-013 Lisboa Portugal
e-mail: email@hidden
e-mail: email@hidden
e-mail: email@hidden
Telefone rede fixa: 351217263568
Telefone msvel: 351965450207
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.