Self Updating An App Using Applescript

I was wondering how I’d be able to self-update an application I wrote in AppleScript?
Basically, the application at startup, should check a web-server which has a text file. The text file has a version number (e.g., 2.0 or 2.2.1), and if the version number is newer than the current application’s version number, the self-update should download the newer application, update it, then run the newer application.
I already have the version number of the application located in the application’s information field which requests short and long version number’s.
I saw some handler’s for self-update, but they were not viewable so I couldn’t get the sourcecode to view examples.

Model: MacbookPro
AppleScript: 2.5
Browser: Safari 602.4.8
Operating System: Mac OS X (10.10)