Sunday, August 23, 2009

Pulling resources from the web

In the upcoming release of muvee Reveal (R15), a new function fetch-uri has been introduced to simplify the task of downloading files from the web at "make muvee time". fetch-uri takes a URL, downloads its contents and returns a temporary path of a local file containing the contents. Some uses of fetch-uri are -

  1. To download media elements at construction time for use within muvees created by your style.

  2. To load .scm libraries directly from a URL.

  3. To query services such as search engines for data based on which other fetch-uri calls can be triggered.


The example style S10000_ImageSearch ("Image Search") is a simple example of how to use fetch-uri to turn photo caption text into images using Google's image search facility. The search functionality is packaged into a module google.scm which you can import into your style (see lib/about.html).

To use the "Image Search" style, add some photos and give them caption text for which Google's image search returns one or more images. In the result muvee, you'll see images from the search results instead of the text you entered.

No comments:

Post a Comment