|
|
(7 mellanliggande versioner av 6 användare visas inte) |
Rad 1: |
Rad 1: |
− | == Usage ==
| + | '''TurfAPI V2''' är en version av [[TurfAPI]]. Se [[:en:Turf API V2|Turf API V2]] på den engelskspråkiga wikin för mer information. |
− | http://api.turfgame.com/v2
| |
− | Will take you to a page asking you to be more specific.
| |
| | | |
− | '''RSS'''
| + | [[Kategori: Tredjepart:Verktyg]] |
| | | |
− | http://api.turfgame.com/v2/rss
| + | [[en:Turf API V2]] |
− | Fetches an RSS-feed containing the 10 latest takeovers in the game.
| |
− | | |
− | http://api.turfgame.com/v2/rss/stockholm/göteborg/skåne
| |
− | Adding regions to the url will make the rss only show takeovers from those regions.
| |
− | | |
− | http://api.turfgame.com/v2/rss/stockholm/?antal=45
| |
− | the GET-variable "antal" lets you choose the number of takeovers to be returned. maximum 100.
| |
− | | |
− | '''User'''
| |
− | | |
− | http://api.turfgame.com/v2/user/tomtebloss/drassen
| |
− | Lets you fetch information about selected users.
| |
− | | |
− | You may also use id:xx instead of the username.
| |
− | | |
− | Example return:
| |
− | | |
− | <?xml version="1.0" encoding="utf-8"?>
| |
− | <turf><user name="Drassen" id="2" rank="31" points="10141" totalpoints="376713" distance="51602.395510" blocktime="30" taken="1846" takenunique="333" region="Blekinge" hour="7" medals="7,9,13,17,17,28,34" zones="10509,1720,9448,9449,9451,10961" place="587"/>
| |
− | | |
− | If you provide a username that does not exist, you will get no return except the <turf> tag.
| |
− | | |
− | '''Zones'''
| |
− | | |
− | http://api.turfgame.com/v2/zones
| |
− | Will return all zones from the game, including pivot points. This action is demanding and is therefore subject to longer caching intervals(2 hours).
| |
− | | |
− | Example return:
| |
− | | |
− | <?xml version="1.0" encoding="utf-8"?>
| |
− | <turf><zone name="EssingeTorget" points_take="170" points_hold="2" lat="59.320361" lng="17.988137"/><zone name="Ulrikzone" points_take="170" points_hold="2" lat="59.317038" lng="18.002661"/><zone name="Trekantzone" points_take="110" points_hold="6" lat="59.311601" lng="18.021929"/>.............
| |
− | | |
− | | |
− | http://api.turfgame.com/v2/zones/plattan/id:3002/
| |
− | Will return only selected zones, but with more information than the example above. You may use either the id or the name of the zone.
| |
− | | |
− | Example return:
| |
− | | |
− | <?xml version="1.0" encoding="utf-8"?>
| |
− | <turf><zone name="Plattan" points_take="65" points_hold="9" lat="59.332250" lng="18.064098" userid="Pelle494" region="Stockholm" takeovers="4923" date_created="2010-09-04 16:41:37"/><zone name="SäveLanding" points_take="185" points_hold="1" lat="57.786081" lng="11.872128" userid="laser" region="Västra götaland" takeovers="101" date_created="2011-09-04 18:36:14"/></turf>
| |