Over the last few weeks, I've spent a lot of time upgrading the recruitment system. It's not the sexiest or busiest part of the website, but it remains important nonetheless because it's how we promote the region to new NationStates nations and bring many new faces and friends to our community! This is one of the first times an entire Wintreath system has been overhauled and announced as one giant update, and the improvements cover virtually everything involving recruitment. So what are these improvements, exactly?
Better and more efficient use of the NationStates APIIn order to display NationStates nations on the recruitment list, we have to request that data from NationStates using the
NationStates API, but the API limits requests to 50 every 30 seconds, which we previously sometimes ran into, resulting in NationStates refusing any more requests from us for 15 minutes. The Wintreath-NationStates API Driver, the piece of code that handles interactions between Wintreath scripts and the NSAPI, has been updated to keep track of the times recent requests were sent out and to not forward requests that would put us in danger of hitting that limit. It also logs all query requests and any errors received while trying to request data from NS, which will make it easier for me to troubleshoot future issues involving the API.
More mobile friendlyYes, I've recruited on my phone before, lol. The page was originally designed for computer monitors, making for a stretched page on mobile. Now the boxes to the right hide themselves when on lower-resolution screens, leaving the box with your telegram template code and stats (a new feature that quickly shows where you stand in daily, monthly, and overall recruitment! If for some reason you want to see the rank lists while on mobile, you just have to click the links in this box to display them and hide them again!
The Recruitment Page on Mobile
Clean, Secure, and Efficient CodeThe recruitment system was originally built in 2014 and then massively expanded in 2015 to take into account other nation stats and to track nations over time to collect stats that we've
occasionally shared out. In the process, the recruitment system code became some of the largest and messiest codes on the website. I went over the code with a fine-tooth comb, reducing its size from 650 to 440 lines, replacing outdated code, and making sure any inputs that entered the script were handled as securely as possible.
API Recruitment IncludedPerhaps the biggest change is that we're now also recruiting using the NS API through the website! We used to use NS++, but it's become less than reliable...now, our API recruitment will tie into the rest of the system. For example, it won't send telegrams to nations that our records show have blocked recruitment telegrams. Nations recruited through the API will still show up for manual recruitment, because using multiple recruitment methods improves the odds that a nation will receive one of the messages.
In the end, these updates should enhance our recruitment ability and make it easier for recruiters to share what we're about to other people looking for a regional home. Please feel free to suggest improvements or ideas for the future, and stay tuned for future updates cause we're always improving.
![Smiley :)](https://wintreath.com/forums/Smileys/newdefault/smiley.gif)