The Swedish tradition of rhyming at Christmas time comes from a rural tradition from the 17th century! On Christmas Eve, it was common to sneak around the houses, knocking on selected doors and quickly throwing a piece of wood through the open door. On the wood, a piece of paper was attached with a mean rhyme about the person who would receive the "shaming gift."
The quirk ended with everyone rapidly leaving in order not to be caught. If you were caught, you could be punished by being forced to take "as many snaps as a pig has bones in the body," which could be a considerable amount.
Merry Christmas!