It allows both high and low level API access.
Features so far:
- - Actively developed with bug fixes and new features being added
- Simple and readable code that is easy to work with
- High level API access to most of shards, basic region and nation information, addressing issues
- Access to all private and public shards
- Low API access with a ton of different utilities to make your API interaction simpler
- Verification API
- Custom UserAgent set
- Enumerables for shards, authority in regions
- Basic Telegram API support
- Get information about cards using Trading Cards API
- Get flags of cards/nations/regions
Link: GitHub Repository (MIT)
Code examples:
High level access
- Code: Select all
// Create an API wrapper
DotNS api = new DotNS();
// Use it to acquire nation information
PublicNationInfo nation = api.GetNationInfo("nation name");
// Access information you need
Console.WriteLine($"Population: {nation.Population}, motto: {nation.Motto}");
Low level access
- Code: Select all
// This will be used for GET request parameters
NameValueCollection nvc = new NameValueCollection();
nvc.Add("nation", "ikteam");
nvc.Add("q", "leader");
var resp = Utilities.API(nvc); // You can also define pass (null by default) and pin (null by default) like Utilities.API(nvc, pass, PIN);
// Use StrResp to convert the API response to XML string
string xml = Utilities.StrResp(resp);
// Use Parse to convert the XML string to NodeList
XmlNodeList nodelist = Utilities.Parse(xml); // By default, it takes nodes by path `/NATION/*`. Use second argument to define the path, like Utilities.Parse(xml, "*");
// Use FindProperty to find a property or attribute by name. Returns first occurance.
string leaderName = nodelist.FindProperty("leader");
Console.WriteLine($"Leader is {leaderName}"); // "Leader is Overlord"
(Find more examples at GitHub page)
More high-level wrappers for shards are coming soon!