In 2012, Twitter fought the New York District Attorney so protect tweets sent by an Occupy Wall Street protester, and in 2014 it sued the U.S. government so that it could share these kinds of user information requests more publicly. Then in 2015, Twitter successfully protected the identity of two anonymous users who were being sued for defamation.
And the company also gets into legal fights where it doesn’t even have a stake. In early 2016, Twitter signed an amicus brief alongside Google in support of PubPeer, a website that allows people to comment anonymously on scholarly articles. PubPeer was being sued by a professor who received unflattering anonymous comments about his work.
Twitter does deserve kudos for this.