Istanbul's 150,000 stray dogs and cats recently got their own vending machines in the Turkish city, and they machines aren't just encouraging the feeding of homeless animals — they're also cleaning up the streets.

The Smart Recycling Box, invented by Turkish company Pugedon, dispenses food for strays in exchange for recycled plastic bottles.

Here's how it works: When someone deposits an empty plastic bottle into the machine, food is released in a dish at the bottom.

There's even a water dish attached so users can pour out any remaining water before recycling it.

Turkish officials allowed Pugedon to install the machines under the agreement that the government wouldn't have to fund them. Instead, the recycled bottles cover the cost of pet food.

The Smart Recycling Boxes will provide a steady source of food for animals that often rely on compassionate residents to feed them.

Istanbul's strays have been a source of contention in recent years.

Some residents enjoy the presence of animals so well-adapted to city life that they stop at traffic lights, but others have asked the government to step in.

These complaints led the Turkish government to draft a law that would transport thousands of animals to a "natural habitat parks" far outside the city, which was met with a backlash from animal-loving residents.

Currently, Turkey's strays are rounded up by municipal authorities that vaccinate and spay or neuter the animals before releasing them back onto the streets with ear tags.

Watch a Smart Recycling Box in action in the video below.

Related on MNN: