Login ID:
Password:
Don't have an account? SIGN-UP
Your Enterprise Visual Workplace™
For the Developer:

Setting-up a live data feed

LiveSPC provides secure interfaces for feeding data to Your Enterprise Visual Workplace™.

Two different mechanisms are provided for delivery of data: a challenge-response protocol useful for delivering data from any computer or server, and a JavaScript module that allows client-side feeds, originating from the client's browser, refered from any specified web domain.

In both methods, sample data (a label and one or more observations) in a tab-delimited text string are fed to the LiveSPC dataset by a simple function call.

Instructions

Each of the available data feed methods require an existing dataset to begin. Once your have registered as a user, and created a dataset, you can begin feeding live data.

First:

  1. Sign-up and get your login verified through email.
  2. Login, and add a 'Dataset'
  3. Enter a title and some text to describe the data being sampled. Add columns for multiple observations in a sample if required, and enter labels for them.

    Note: You may also manually enter data, or import a CSV file to your dataset, to get started using LiveSPC. This is useful for evaluation and experimentation, or for transfering initial data from other sources. The first row in the CSV file will be used as the data labels.

    If you intend to use client-side data feeds you must enter the domain name for the website in the provided field. The domain name is used to calculate a 'PC' value that must be returned to LiveSPC.com by the JavaScript.

    Note the ID and PASSCODE at the bottom of the edit page. You will need this ID and passcode for the secure protocol implemented by the LiveSPC challenge-response agent.

    Note the PC hash code for LiveSPC.js taps near the center. You will need the ID and PC for the secure protocol implemented by the LiveSPC client-side direct feed JavaScript module. Enter the domain (do not include the www.) and click the 'calculate' button to refresh the hash value.

  4. Setup your live data feed:
  5. From Any Computer or Server

    You can send live data feeds from any computer or server using the LiveSPC Challenge-Response Agent. This Agent can APPEND or REPLACE samples in the dataset using a secure protocol.

    APPEND accepts 1 or more tab-delimited lines of text that are parsed:

    sample-label Observation-1 (Observation-2) (Observation-3)...

    and appended to the specified dataset. The specified dataset must exist.

    REPLACE discards all samples in the dataset before adding the samples being fed.

    LiveSPC Challenge-Response Agent

    The following example reads a tab-delimited text file containing labels and samples, and feeds it to LiveSPC.com where it is parsed into a dataset using the REPLACE keyword.

    Note in the example a single call to submit the data to LiveSPC:

    
    my $success = LiveSPC::updateData($dataset, $passcode, 'REPLACE', $text);
    if ($success) {
    
    print "<<\n$success\n>>\n";
    print "data submitted successfully\n";
    
    } else {
    print "data NOT submitted successfully\n";		
    }
    				
    • $dataset must contain the data ID number.
    • $passcode must contain the 8-character passcode value copied from the data page.
    • The third parameter must be either 'REPLACE' or 'APPEND'.
    • $text must contain the tab-delimited label and observation(s).

    This function returns the parsed sample values in the result on success so that you can verify that they have been processed properly.

    You can invoke the example from the command line:

    update.pl datasetID passcode filename

    Example file uploader:

    • Perl: update.pl
    • PHP: (not yet)
    • Python: (not yet)

    The example tab-delimited file: example.txt

  6. Create a report, select the dataset, representation, and size. Then click SUBMIT.
  7. Now you should see a graphical representation.

    The next example shows how your code can read information from a database and feed it to LiveSPC.com where it is parsed into a dataset using the APPEND keyword. This code is used to monitor LiveSPC user stats.

    LiveSPC user stats monitor:

    Note that the graphics and stats are all calculated by the client browser and are updated whenever the data on the server changes.

    Client-Side JavaScript Module

    You can submit new sample observations directly from JavaScript in your web page without any server script or cron job. This works great for any data you wish to capture from a form or from any other script result. All you have to do is embed this:

    in your web page source to submit data.

    The var LiveSPC_DT gets delivered and parsed into the dataset whenever the page is loaded. LiveSPC_PC is a special code that is an MD5 hash of the passcode and the domain (you have to enter it) that will be allowed to feed data. You copy it from the bottom of the 'edit this dataset' page. The LiveSPC_ID is the dataset ID number.

    LiveSPC_DT is tab-delimited text that gets parsed into a new row in the dataset. Note the '%09' tab embedded in the text.

    I'm using client-side feeds now to track which articles people read on water-rockets.com. Note the Pareto chart in the upper left corner showing the frequency of the different article numbers being viewed.

    The Pareto will update when each new page is rendered. Great fun to watch, the bars grow and shift around over time, but a bit like watching paint dry, though, at 20 or 25 hits per hour. :-)

    Another JavaScript module is available for use from within your page scripts. Include the module in your html HEAD section:

    ...then your scripts can invoke the function:
    to APPEND observations to your dataset.

Live Feed Example

A log watcher on water-rockets.com feeds page-impression data to a dataset, and is accessable through a public report. You can see it here:

http://livespc.com/public.pl?reportID=1

Once you are signed-up other users can share reports with you without making them public.