Having spent 270 days in a shelter, the dog leaped with happiness when someone finally gave him some attention