Yes, this is exactly what I did; I wrote a Ruby script to add all the Permalinks.
This worked! Thank you.