I was reading a collection of graffiti from 1731 called "The Merry-Thought" last night— Nigel Rees before Nigel Rees— and somehow I had not expected this joke to be so old.
More about the book:
I can't now find where I found the scan, but Gutenberg has the text:


The Public Domain Review
Loos, Lewdness, and Literature: Tales from the Boghouse
In the early 1730s, a mysterious editor (known only as “Hurlothrumbo”) committed to print a remarkable anthology: transcriptions of the graffit...

Project Gutenberg
The Merry-Thought: or the Glass-Window and Bog-House Miscellany. Part 1
Free kindle book and epub digitized and proofread by volunteers.
