[EDIT Disclosure: This answer is written by the TAGS author and includes links to his personal blog]
The Twitter Archiving Spreadsheet Template (TAGS) template mentioned in the question comments is one solution that has been continually developed to address Twitter API changes. This post will direct you to the latest version, alternatively Open this Spreadsheet and File > Make a copy and follow the setup instructions on the Readme/Setting sheet.
[The spreadsheet template has been used for a number of visualisation/analysis tools including TAGSExplorer and TAGSViewer] as well as tutorials such as 'Twitter Data for Really Targeted Outreach' and combining with Google Analytics referral data]