Parfait Logo

PARFAIT

Programmable API Reducing Feeds And Information Threads

Because feeds got layers!

version 2017.01.06.22

Introduction

PARFAIT is a web API that provides a method for concise weather data or RSS feed data to be imported or consumed when the raw XML formatted file is larger than allowed to be imported and processed by the recipient, when the recipient can't handle XML, or when the recipient wants some simple data already processed out. The size issue was especially true for Second Life (a virtual world) at the time this API was first developed in 2011, and was the reason for PARFAIT to be developed. It is assumed that since virtual worlds have many constraints around processing live external data, this will be the primary use. However, due to the ability of the API to preprocess and return specific weather datum, it is expected that there will be some use in other 'real' world situations.

To learn how to retrieve current weather observations, refer to the documentation here: help-current.php.

To learn how to retrieve forecast weather information, refer to the documentation here: help-forecast.php.

To learn how to retrieve Reuters news feeds, refer to the documentation here: help-reuters.php.

To learn how to retrieve NASA news feeds, refer to the documentation here: help-nasa.php.

To learn how to retrieve ESPN news feeds, refer to the documentation here: help-espn.php.

For more information or assistance with this website, please e-mail me: Mike@OmegaTower.com.

The weather data is courtesy of NOAA's National Weather Service.
The Reuters news feeds are courtesy of Reuters.com.
The NASA news feeds are courtesy of NASA.
The ESPN news feeds are courtesy of ESPN.

Brief Overview

With the exception of the Current Datum and Current Capsule which return a single text string, the returned data is in a double (or triple) delimited format. That is to say that the lines of data have a unique terminators, and the data elements have a different unique delimiter. This allows the use of layered string splits to retrieve the data element required. Calling for the current conditions with 'head', 'high' and 'extra' layers will return something like this:

hd*ParfaitAPI*http://parfait.snarkybox.com/*current****KLAX**head,high,extra*20141210*2118*68.100.18.139*2014.12.10.13~hi*Los Angeles Intl Airport, CA*Last Updated on Dec 10 2014, 5:53 pm PST*Overcast*62.0 F (16.7 C)*90*Southwest at 4.6 MPH (4 KT)*59.0 F (15.0 C)**62 F (17 C)*7.00*ovc.png~ex*33.94*-118.4****1013.9 mb*1013.9*29.94**~

This is three lines, one for the header information and one for each layer requested, with the lines terminated with a '~' character. So, using an split operation on the full string would separate it into three lines:

hd*ParfaitAPI*http://parfait.snarkybox.com/*current****KLAX**head,high,extra*20141210*2118*68.100.18.139*2014.12.10.13~
and
hi*Los Angeles Intl Airport, CA*Last Updated on Dec 10 2014, 5:53 pm PST*Overcast*62.0 F (16.7 C)*90*Southwest at 4.6 MPH (4 KT)*59.0 F (15.0 C)**62 F (17 C)*7.00*ovc.png~
and
ex*33.94*-118.4****1013.9 mb*1013.9*29.94**~

From here, another split operation on each of the strings will allow for the selection of an individual datum. In addition to the tilde and asterisk shown here, the forecast and other news feeds have an additional terminator placed at the end of each layer section: the pipe '|'. The full specification for the data returned by each of the different layers is fully explained in the help files (help-current.php, help-forecast.php, help-reuters.php, help-nasa.php and help-espn.php).

To determine which line you want to look at you can test against the first two characters of each line to find its identifier code.

layer name layer code current API forecast API ReutersAPI NASA API ESPN API
head hd X X X X X
meta mt X X X X X
other ot     X   X
low lo X X X X X
high hi X X X X X
extra ex X        
water wa X        
hazard hz   X      
error er X X X X X

In Second Life I used these calls to create various weather related objects that would display live observed real world data as well as broadcast the current weather and forecast information to others in the region. Currently I am working on creating a digital clock with live temperature and news crawls.

Version Notes

2017.01.06.22

2016.11.10.21

2016.10.30.20

2016.03.19.19

2016.03.09.18

2016.02.12.17

2015.07.28.16

2015.07.23.15

2015.04.08.14

2014.12.10.13

2014.11.16.12

2014.11.15.11

2014.11.08.10

2014.11.05.09

2013.12.29.08

2013.12.28.07

2013.09.27.06

2013.09.25.05

2013.09.11.04

2013.09.08.03

2013.09.06.02

2013.08.14.01