The short clip below is from the BBC Four documentary Mechanical Marvels: Clockwork Dreams on the history of automata, narrated by Prof. Simon Schaffer. It shows a mechanical boy known as the writer, the brainchild of Pierre Jaquet-Droz (1721–90), a Swiss watchmaker who became renowned for this and similar works.
The writer comprises about 6000 parts and contains 40 replaceable interior cams that allow it to write – using a goose-feather quill – any text of up to 40 characters. In other words, it’s programmable. The machine has an uncanny quality charged by the movement of its eyes as they follow the composition of letters and the refilling of the quill with fresh ink (which it briefly shakes, to prevent blotting).*
Update: Public Domain Review has a fine illustrated essay by Jessica Riskin on the history of automata.