Yabu: Another method of data export

Post any bugs, problems or feature requests here.
Brend
Veolian Commonwealth
Mercury
Mercury
User avatar
Veolian Commonwealth
Faction
 
I have written 'Yet Another Backend Update'. This time its another form of data export. This makes it even easier for tech-savvy people (e.g., me) to write little tools that consume FWURG data.

This post is mainly here for the record. This way I can quickly look up the features of my own data export, and allow others to (hopefully) be inspired to write some interesting tools. There are two ways to retrieve data.

Data per Item
The first method offers access to all data on a single wiki page. You don't need to know any difficult querying language, you only need the wiki id of the data you want to retrieve.

The following URIs will provide you with data:
Code: Select all
Main item:   http://fwurg.xs4all.nl/data-api/item/{pageid}
All items:   http://fwurg.xs4all.nl/data-api/item/{pageid}?entry=*
Single item: http://fwurg.xs4all.nl/data-api/item/{pageid}?entry={entryid}

Some examples:

Data list
The second option is to get a list of data items. This list can (and should) be filtered to select only those items of interest.
Code: Select all
Filtered list: http://fwurg.xs4all.nl/data-api/list/{filter}

For example http://fwurg.xs4all.nl/data-api/list/system=smi-halek_system;:class~developed lists all developed zones in the Smi-Halek System.

The filter is really simple: just add a bunch of filters seperated with a semi-colon.

The four special fields are addressed as '':class'', '':page'', '':entry'' and '':title''. all other fields are addressed simply by their name (case insensitive).

The following operators are understood:
  • ~, contains
  • ^~, starts with
  • $~, ends with
  • =, equals
An example: Alice wants to get all small planets with a Type I atmosphere. She starts out with a simple planet filter, ":class~planet", getting her all the data that's about a planet. Next she refines her query with "atmosphere=Type I", selecting from the list of planets only those planets with an atmosphere equal to "Type I". Now she only needs to add "zones=7" to filter out any non-small planets. Alice ends up with :class~planet;atmosphere=Type I;zones=7 which does exactly what she wants.

Of course, this only selects planets. If she doesn't care whether they selected things are planets or moons, she can just remove the ":class~planet" filter and get all things with 7 zones and a Type I atmosphere.
Post Mercury » Sun Jan 29, 2012 11:40 am
User avatar
Mercury
Storyteller
 
Very awesome! I think this will be most useful!

Return to Technical

cron