Constituents of a particular index by year

Does anyone know of a way to gather the symbols that make up an index, e.g., SP500, over time? Any pointers would be appreciated.