Configuration

Global Configuration

The global_config.yml file holds application-level settings.

default_site: directory name of the default site to be served in a multi-site installation if no domain match is found. If this option is not set, TweetScope will display the first site alphabetically.

cache_max_age: cache expiry time, in seconds. No caching is performed by TweetScope itself, this simply sets the value of the Cache-Control header for use with an external caching system.

Site Configuration

Each site's config.yml file holds site-specific settings.

Query Settings

language: restricts tweets to the given language, given by an ISO 639-1 code.

count: the number of tweets to return per page, up to a maximum of 100.

geocode: returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile. The parameter value is specified by "latitide,longitude,radius", where radius units must be specified as either "mi" (miles) or "km" (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly.

Text Snippets

The default theme uses the config file to set the site title and tagline. Additional snippets of text can be added following the same key/value convention and accessed in the view template with @site['keyname'].

Site Settings

cache_max_age: the global cache expiration can be overridden on a site-by-site basis.

domain: a domain where this site is accessible (see Multiple Sites below).

domains: a collection of domains where this site is accessible (see Multiple Sites below).

Multiple Sites

A single instance of TweetScope can run many different sites. The domain (or subdomain) being requested is checked against all sites that have the domain or domains option set. If a match is found, that site is served.

When testing locally, sites can be accessed at http://localhost:4567/sitename