Reddit and Twitter have APIs. OpenAI used Twitter API until a few days ago when Elon paused it. But also just look at ChatGPT itself, it has a lot of data ingested, knows every npm library and lots of links in its dataset.