Tpbcrawler is a project mainly written in Java, it's free.
This utility grabs new torrents from the pirate bay and stores certain data in a mysql database