Using
Applescript to call Unix apps, Web Services (XML-RPC, Soap), and regular Mac applications. So, using web services, you could get the current stock prices, weather, and world news and use that information to decide the music genre your script has iTunes play: blues, angst, or bubblegum.