Procedurally Animated Spider

I want to do exactly what you said, but don’t know where to start or how to join the legs.