In 2008, American diplomats in Beijing quietly installed an electronic monitor outside the U.S. Embassy to test pollution levels in the Chinese capital’s famously sooty air. The results, posted daily on the Internet, were mainly intended for U.S citizens and visitors, but soon ordinary Chinese were logging in for reliable information about health threats in the air they breathed.