I am writing a script that checks if given domain is parked or not. so far, I have this solution:
It's not as simple as that. A 302 response just means content is temporarily at a different location. This can happen on a normal website and it doesn't always happen on a parked site.
I worked at an ISP with over 20,000 parked domains and we didn't use 302's on any of them.
I don't think you'll find a 100% solution for this. Even if you checked the page for phrases such as "Buy This Domain" and "This Domain May Be For Sale" you won't know for sure.