set t to do shell script "/usr/bin/curl " & quoted form of "http://www.fifa.com/worldfootball/index.html"
set {TID, text item delimiters} to {text item delimiters, "Latest Fixtures and Results"}
set t to text item 2 of t
set text item delimiters to "All Fixtures and Results"
set t to text item 1 of t
set text item delimiters to "td class=\"c\">"
set v to text items of t
set text item delimiters to TID
set datelist to {}
repeat with i from 2 to count v
set end of datelist to strip_text(item i of v)
end repeat
set text item delimiters to "/index.html\">"
set v to text items of t
set x to 1
set y to 1
set gameList to {}
repeat until y = (count v)
if item y of v does not start with "<" then
set end of gameList to item x of datelist & ": " & strip_text(item y of v) & " - " & strip_text(item (y + 1) of v)
set y to y + 2
set x to x + 1
else
set y to y + 1
end if
end repeat
set text item delimiters to return
set gameList to gameList as text
set text item delimiters to TID
display dialog gameList
on strip_text(s)
return text 1 thru ((offset of "<" in s) - 1) of s
end strip_text
set t to do shell script "/usr/bin/curl " & quoted form of "http://www.fifa.com/worldfootball/index.html"
set {TID, text item delimiters} to {text item delimiters, "Latest Fixtures and Results"}
set t to text item 2 of t
set text item delimiters to "All Fixtures and Results"
set t to text item 1 of t
set text item delimiters to "td class=\"c\">"
set v to text items of t
set datelist to {}
repeat with i from 2 to count v
set end of datelist to strip_text(item i of v)
end repeat
set text item delimiters to "/index.html\">"
set v to text items of t
set x to 1
set y to 1
set gameList to {}
repeat until y = (count v)
if item y of v does not start with "<" then
set theResult to ""
if item y of v contains "strong" then set theResult to get_result(item y of v)
set end of gameList to item x of datelist & ": " & strip_text(item y of v) & " - " & strip_text(item (y + 1) of v) & space & theResult
set y to y + 2
set x to x + 1
else
set y to y + 1
end if
end repeat
set text item delimiters to return
set gameList to gameList as text
set text item delimiters to TID
display dialog gameList
on strip_text(s)
return text 1 thru ((offset of "<" in s) - 1) of s
end strip_text
on get_result(r)
set {TD, text item delimiters} to {text item delimiters, "<strong>"}
set r to text item 2 of r
set r to strip_text(r)
set text item delimiters to TD
return r
end get_result