Export Formats

GridHop supports the hypergrid community. We do that because we think that the data captured by the GridHoppers are valuable and should be shared among the community.

Actually we support three types of exports. That's plain XML, JSON and the HG Notecard definition.


Prelude

URL: http://www.gridhop.net/cgi/gridhopexport?format=prelude

The prelude gives you the following info's, each on a separate line. PAGESIZE, this is the number of destinations you get with a page request.m Usually 50. PAGES, ow many pages you can request and finaly a comma separated list of tagid=tagname.

Looks like:

 PAGESIZE=50
 PAGES=2
 71=party,72=money,73=economy,74=art,75=game,...

XML

URL: http://www.gridhop.net/cgi/gridhopexport?format=xml

XML format has this structure:

 <!ELEMENT hypergrid (destination*)>
 <!ELEMENT destionation (simulatoraddr, simulatorport,
   regionname, globalpos?, parcelname?, landingpoint?)>
 <!ELEMENT simulatoraddr (#PCDATA)>
 <!ELEMENT simulatorport (#PCDATA)>
 <!ELEMENT regionname (#PCDATA)>
 <!ELEMENT globalpost (startxloc, startyloc)>
 <!ELEMENT startxloc (#PCDATA)>
 <!ELEMENT startyloc (#PCDATA)>
 <!ELEMENT parcelname (#PCDATA)>
 <!ELEMENT landingpoint (x, y, z)>
 <!ELEMENT x (#PCDATA)>
 <!ELEMENT y (#PCDATA)>
 <!ELEMENT z (#PCDATA)>
 <!ELEMENT tags (#PCDATA>

An example:

 <hypergrid>
   <destination>
     <simulatoraddr>tx.icf.de</simulatoraddr>
     <simulatorport>9095</simulatorport>
     <regionname>Freiland</regionname>
     <globalpos>
       <startXloc>10000</startXloc>
       <startYloc>10002</startYloc>
     </globalpos>
     <parcelname>Freiland</parcelname>
     <landingpoint>
       <x>112</x>
       <y>111</y>
       <z>50</z>
     </landingpoint>
     <tags>1,4,77</tags>
  </destination>
        :
        :
 </hypergrid>

JSON

URL: http://www.gridhop.net/cgi/gridhopexport?format=json

The same in json:

 {
    "hg": [
        {
            "dest": {
                "lpos": {
                    "y": 111,
                    "x": 112,
                    "z": 50
                },
                "pname": "Freiland",
                "gpos": {
                    "y": 10002,
                    "x": 10000
                },
                "rname": "Freiland",
                "port": "9095",
                "addr": "tx.icf.de",
                "tags": "1,4,77"
            }
        },
        :
        :
    ]
 }

HG Notecard

URL: http://www.gridhop.net/cgi/gridhopexport?format=notecard

And now in the HG Notecard specification:

 # <---  this is a comment  
 # UPDATED: JULY-19.2009
 # ------ HyperGrid Notecard FORMAT 
 # HgSite=GridName|RegionName|DestinationID|TargetAddress<:port|<TargetLandingVector>|<TargetLookAtVector>|tag1|tag2|tag3
 #   NOTE  RegionName MAX SIZE = 24 (will cause menu to fail). Shorter is Better
 #

 HgSite=OSGrid|Freiland|15|tx.icf.de:9095|<112,111.50>|<112,111,50>|1|4|77

Extra parameters

page

With the formats xml, json and notecard you can give a parameter page to request a specified page from a longer result. You get the pagesize and the number of pages when you request the prelude format. Say we have 30 pages with a pagesize of 50, you get page 23 with 50 entries when you add page=22 as a parameter to your xml, json or notecard request. The page number starts at 0.

Example URL for notecards:

http://www.gridhop.net/cgi/gridhopexport?format=notecard&page=22

If you omit this parameter you get the output in one request.

tagids

With the formats xml, json and notecard you can give the parameter tagids. The argument to that parameter is a comma separated list of tagid's. The result is the list corresponding to the tag id's.

Example URL for notecards and tagid's 77 and 81:

http://www.gridhop.net/cgi/gridhopexport?format=notecard&tagids=77,81

tagstart

With the formats xml, json and notecard you can give the parameter tagstart. The argument to that parameter is starting letters of the tags of the destination. The result is the list corresponding to the tags.

Example URL for notecards and all tags star with 'm':

http://www.gridhop.net/cgi/gridhopexport?format=notecard&tagstart=m

hide_unreachable

With the formats xml, json and notecard you can give the parameter hide_unreachable. Set the argument to 1 and result is the list without the unreachable destinations.

Example URL for notecards without unreachable tagged destinations:

http://www.gridhop.net/cgi/gridhopexport?format=notecard&hide_unreachable=1