Pencil Mate simply slides onto any standard sized pencil and contains a strong neodymium magnet, which enables the pencil to be attached to any ferromagnetic surface.
If, like most glasses, yours are not ferromagnetic (meaning that magnets will not attach to them) just stick a small strip of flexible ferrous tape onto your glasses.