Dist::Zilla::Plugin::Twitter gets an OAuth update

My pluginbundle for Dist::Zilla includes, among other things, the Twitter plugin so I can brag on Twitter every time I release a module. Mysteriously, it broke one day. Looking at the code, I realized that it was sending my username and password to authenticate. I remember being uneasy with that at the time I set it up, but I quickly forgot, and continued along blithely. OAuth is an authorization standard that allows users to avoid giving their username & password to a potentially-untrusted application. Using OAuth has been requested since 2011, and the 401 Unauthorized error I got indicates that now it is mandatory for Twitter.

David Golden offered to let me maintain the module, and I’m a sucker, so… :D

The 0.015-TRIAL release should implement OAuth correctly (thanks to Marc Mims for helping me), resolving both the error where releasing bails out because tweeting failed, and also resolving the  underlying authentication failure. On the first run, you should be prompted to re-authorize the plugin at Twitter, but on subsequent runs, it should use the stored access token and secret pair. Please give it a try and let me know what I’ve done wrong.