How do you import text from an outside source, like a website or text file?

I want to make a plug-in that extracts data to use for  other purposes.