An automated gold purchasing machine in central Shanghai was drawing crowds as prices of the precious metal soared to a fresh record near $5,600.