The Pirate City: An Algerine Tale by Ballantyne, R. M. (Robert Michael)
 is a Project Gutenberg book, now on Github.