These functions were taken from the reddit package

This will need some serious modifications...