Thiophene-containing organometallic polymers studied by near-edge x-ray absorption spectroscopy