The KPI Dashboard – Evolved
1-877-233-6149
Contact Us

Klip Developer Guide

Table of Contents

1.2. A Closer Look at Klips

A Klip runs within Klipfolio Dashboard. That is to say, Klipfolio Dashboard provides your Klip with a complete runtime environment for execution.

A Klip is an XML file. When Klipfolio Dashboard loads your Klip for execution, it parses the Klip's XML for specific elements, such as a URL for your content source, which is usually an HTTP or HTTPS address.

A Klip can be written in a few lines of XML. You can actually write working Klip in seven lines of XML. If you do, Klipfolio Dashboard's default logic for accessing, parsing, processing, and displaying content will provide you a fully working Klip.

A Klip may contain JavaScript. You can include JavaScript to override Klipfolio Dashboard's default logic. In addition to the built-in JavaScript interpeter, Klipfolio Dashboard provides you with a rich application programming interface (API) that exposes many of the Klip's underlying data structures to your JavaScript.

Klipfolio Dashboard strives to maintain the smallest possible footprint on your desktop. That's by design.

Klipfolio Dashboard's architecture enables you, the developer, to write powerful Klips in a few lines of XML and JavaScript. That's also by design, and this Guide will show you how.

Klipfolio Dashboard's default logic enables your Klip to easily parse data in both RSS and Atom formats. But what if your content source isn't in RSS?

1.2.1. Parse Any XML

A Klip can parse any XML, CSV, or TSV data. (This document will focus on XML but applies to CSV and TSV data as well.) Using a Cascading Style Sheets (CSS) syntax, a Klip can instruct Klipfolio Dashboard's XML parser on exactly how to extract elements from the incoming XML. If you are familiar with how CSS works in a web page, you will quickly grasp how to use it in a Klip.

1.2.2. Extract Data from Any Site

A Klip can extract data from any web site. Using a combination of CSS to parse XML and JavaScript to create custom logic, a Klip can precisely mimic the interaction of a browser with a remote site. In other words, if you can see it in your web browser, a Klip can reproduce the exact interaction with the web server needed to retrieve the same data you see in your web browser. Only a Klip can do it automatically, at regular intervals, and alert you — based on your preferences — when the data changes.

1.2.3. Common Steps in a Klip

A Klip always goes through four steps to refresh its display to the user. These steps are as follows:

  1. Access remote content source.

  2. Parse the incoming XML.

  3. Process the XML.

  4. Display new and updated content in the Klip to the user.

The last step also includes displaying alerts if you have set up the Klip for alerting.

1.2.4. Consistent Interface

While the content in every Klip is different — with different content, columns, images, tooltips, etc. — each Klip behaves exactly the same way to the user.

For example, a tooltip is displayed whenever a user moves the mouse over an item in a Klip.

Figure 1.2. A Klip with a Tooltip

A Klip with a Tooltip

From the developer's perspective, this consistency makes it very easy to build a Klip. All the UI drudgery normally associated with management of an interface is done for you by Klipfolio Dashboard. Once you've covered the four common steps with a Klip, Klipfolio Dashboard takes care of the rest.

When you write a widget or create a full-blown application from scratch, such environments are a blank canvas and you are responsible for everything, including creating a good UI for users. On the other hand, the consistency of a Klip means that you can have a finished, working Klip ready for deployment in much, much less time.

1.2.5. Size Matters

Klipfolio Dashboard itself is just over a megabyte in size. As a point of pride, our developers grudgingly yield every kilobyte in download size and every percentage of CPU usage when adding features in each new version.

This means that, even when Klipfolio Dashboard must process large amounts of remote content and simultaneously refresh dozens of Klips, it keeps a low profile on your computer.