I made this fun thing for demo purposes a little while ago. It uses the API tools at
datamuse.com to pick out words on the theme you choose, and
then figures out how many syllables you need to complete a line. Easy!