automatic wurfl downloads

Note: This method to update the WURFL file is now deprecated. Please use the WURFL Updater instead.

Automatically Updating WURFL file

All ScientiaMobile API customers are given access to a direct download URL for obtaining the latest WURFL snapshot. This is either the weekly snapshot (released on Sunday night), or an Out-Of-Band snapshot that we release to our customers between weekly snapshots in case of a significant improvement to the data (for example, if a high-profile device is released mid-week and it is not yet in WURFL). The snapshots are licensed to your organization with your commercial license included.

To locate your direct download URL, login to scientiamobile.com and go to My Account. Once a license has been acquired, you will be able to access your download URL by clicking on View Account, which will contain the download link for your license. This URL is unique to you and must be kept private.

The direct download URL supports the following methods to check for updates:

  • HTTP HEAD Request: You can send an HTTP HEAD request to your direct download URL and it will return the size of the current snapshot and the date last modified.
  • HTTP If-Modified-Since: If you include the If-Modified-Since HTTP header, the server will only return the snapshot if it is newer than the specified date.
  • HTTP If-None-Match / ETag: Our download system sends an HTTP ETag header along with the snapshot. If this ETag is recorded, you can send it back on subsequent requests in the HTTP If-None-Match header, and the snapshot will only be returned if it is different than yours.

The recommended method is If-Modified-Since. It is well supported among download clients and you don't need to record anything on your side to be able to use it.

Note: Dates in the HTTP headers are in UTC, not your local time.

Checking for WURFL updates automatically

The simplest method for keeping the wurfl.xml file up to date is to download the WURFL Updater package available here.

Linux / UNIX / Mac OS X

The linux/ folder contains a script that can be used to update the WURFL file on Linux, UNIX, Mac OS X and perhaps other UNIX-like environments.

To see the usage information, run ./wurfl-uploader.sh with no arguments:

$ linux/wurfl-updater.sh
ScientiaMobile WURFL Snapshot Updater
This utility is used to update the WURFL.xml device database file.
Note that the file format (zip or xml.gz) is determined by the URL.

usage: ./wurfl-updater.sh <url> <download_path>
  url            The WURFL Snapshot URL from your customer vault on scientiamobile.com
                 ex: https://data.scientiamobile.com/xxxxx/wurfl.zip

  download_path  The directory to place the WURFL file into.

Note: The filename will be the last segment of the snapshot URL (either wurfl.zip or wurfl.xml.gz).

To download or update your WURFL file, pass the WURFL Snapshot URL from your customer vault on ScientiaMobile.com as the first argument and the directory that you want the file to be downloaded into as the second argument.

When you run the updater, if there is not a local copy of the file, the file is downloaded. If there is a local copy of the file but it is out of date, the updated version is downloaded, otherwise nothing is downloaded.

Windows

For Windows users there is a Visual Studio project that can be used to generate the updater exe file. This program will work exactly the same way as the Linux script, with the same command-line arguments.

Examples

Linux:

# Success or already up-to-date
$ ./wurfl-updater.sh https://data.scientiamobile.com/xxxxx/wurfl.zip /tmp
Updating /tmp/wurfl.zip via CURL

# URL or License is invalid
$ ./wurfl-updater.sh https://data.scientiamobile.com/xxxxx/wurfl.zip /tmp
Updating /tmp/wurfl.zip via CURL
curl: (22) The requested URL returned error: 402 Payment Required

Windows:

# Success
C:\temp\WURFLUpdater.exe https://data.scientiamobile.com/xxxxx/wurfl.zip c:\temp
Downloading WURFL file...
Successfully downloaded WURFL to: c:\temp\wurfl.zip

# File is already up-to-date
C:\temp\WURFLUpdater.exe https://data.scientiamobile.com/xxxxx/wurfl.zip c:\temp
Downloading WURFL file...
The WURFL File is up to date.

# URL or License is invalid
C:\temp\WURFLUpdater.exe https://data.scientiamobile.com/xxxxx/wurfl.zip c:\temp
Downloading WURFL file...
Unexpected status code: HTTP 402: Payment Required

License

2017 ScientiaMobile Incorporated All Rights Reserved.

NOTICE: All information contained herein is, and remains the property of ScientiaMobile Incorporated and its suppliers, if any. The intellectual and technical concepts contained herein are proprietary to ScientiaMobile Incorporated and its suppliers and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden unless prior written permission is obtained from ScientiaMobile Incorporated.