With this project, I only had to buy glue. This is like- super recycling :B
Open it a bit, and shape it so that it's a wire with an eye. Get a little stick, or, like I did, kill a hair pin and put that through the eye of the wire to keep it in place, and start pouring your old nail polish in. It doesn't have to be a nice colour, you can always polish an extra layer. I have also done this with nail polish which somewhat got seperated. Like, when I put it in the cap, the nailpolish went all cracky and the oily substance tried to come out. I just poured glue over it and polished it afterwards, and its exactly the same as this one.
Let the nailpolish dry. This can take quite some time. I let it dry in my room, which isn't a very good idea when you got to sleep there. Let it dry at a well ventilated place.
When it's all dried up, you can put the glue over it. I used transparent all purposes glue. When that's dried up, you can get the bobby pin or little stick out.