Basically I have written a game plugin that will allow server admins to update their administration tools from within game rather than having to go download it and install it. The releases are updated regularly, and the beta versions are nightly builds.
I am trying to find a way to grab the links from the website, but I cannot think of anyway to do this off of the top o开发者_Python百科f my head. Was hoping someone here might be able to suggest something that would work.
http://www.sourcemod.net/snapshots.php
Thats the website, basically I am trying to grab the links for the latest stable branch, and latest development branch.
The solution is simple and can be broken down into a few steps:
Fetching the links & files: Use cURL/cURLpp or Poco C++. They are easy but you may spend a few hours to learn :)
Processing/Extracting the links: Use TidyHTML to make sure the HTML is converted to valid XHTML and use XPath to extract the links. Can use libxml2 & libxslt. I'd prefer Qt C++
Fetch the extracted links and save them to pre-defined paths. Boost Filesystem may ease your task with file system.
Note that if I were to do this (well, I've done this before), I'd use only Qt C++ as it provides everything I need. Btw, Qt C++ has a dead simple way to send GET/POST requests & fetch files :) Good luck!
EDIT:
Qt C++ XML also provides CSS-like selectors which avoids you using any other libraries: http://doc.trolltech.com/4.6/qt4-6-intro.html#dom-access-api
In short: Just go for Nokia Qt C++ in all the steps. Download from: http://qt.nokia.com/downloads
you could ask them if they have some sort of web service to call?
i.e. you could request the latest version which would return a revision number, you compare that against your current version, if an update is required you call another web service to request the location of the files to download.
精彩评论