As a pedestrian, I regularly pick up nails, screws, staples, etc. Less frequently as a cyclist. But, I did stop for a box of staples that had been dumped. One driver stopped (giving me a traffic break). The next complained about me saving him a trip to the tire shop.
I like that magnet idea. I picked up a little wheel powered rotary sweeper that I was hoping would pick up glass, but I don't think it would do very well on a single pass. So, perhaps multiple trips.
I have a harbor freight magnet that is a little wider than the one above that I may try when I have the ambition to just ride.