removed main, function parser requires filename and either 'a' or 'img' and will output either links.txt or images.txt