scorecardresearch

Which Mass. mayor is ‘most talkative’ on Twitter? This Brookline resident scraped data to find out

A Brookline resident scraped Twitter data to find out how some mayors use the social media platform. “Fiorentini number 1!” wrote the mayor of Haverhill.
A Brookline resident scraped Twitter data to find out how some mayors use the social media platform. “Fiorentini number 1!” wrote the mayor of Haverhill.(Jonathan Abbett)

During the runup to the midterms earlier this month, Brookline resident Jonathan Abbett used Twitter to reach out to candidates running for office, hoping to hear from them about their stands on issues.

When he received a few replies — specifically from Democratic gubernatorial candidate Jay Gonzalez and Tommy Vitolo, a candidate for state representative in Abbett’s district — the gears in Abbett’s head started turning. How often do people in office actually get back to their Twitter followers, he wondered.

“Most of the time on Twitter it’s a lot of one-way, press release-style communication,” Abbett said. “It’s just people sort of posting things, and then thousands of responses that seem to never go anywhere.”

Advertisement



So Abbett turned to Twitter’s open data to find an answer.

During some “quiet time” at home over the Thanksgiving holiday, Abbett launched a side project examining how interactive and responsive the Twitter accounts of 47 mayors across the state have been in the last 90 days. (Note: Some mayors don’t have accounts, while others have two — one for their campaign and another for their office.)

While it’s by no means an authoritative analysis of each mayor’s entire history on the social media platform, and doesn’t look at the actual substance of the tweets, the information does offer a snapshot of how the leaders with accounts tend to engage online.

“It’s fun, but it’s also something that I care about,” said Abbett, a software designer. “Even getting a baseline for ‘Is your tweet going to be ignored?’ and ‘How likely is it that somebody is going to respond to you?’ — I think that’s important as a citizen.”

Abbett said he rounded up the list of mayors manually. First, he got the names of officials from the Massachusetts Municipal Association’s website. Then he looked up the Twitter accounts for each mayor listed on the site by searching on Google. He “scraped” the data he needed by writing a computer script and accessing Twitter’s API, or application programming interfaces.

Advertisement



“The hardest part of the work really is collecting Twitter screen names,” he said. “Once you have all the screen names collected, it just takes a few minutes to collect all of the data.”

Once he had the data, Abbett displayed it on his website in an orderly table with different columns.

The findings can be sorted by city or town name, by mayor’s name, by population, by tweets per day, by tweets in the last 90 days, by replies in the last 90 days, and by replies per day.

There are also tables — complete with profile pictures — that show the top five “most responsive” and “most talkative” mayors in the state over the last 90 days, information that’s based on the number of tweets that were replies to others, and total tweets, including replies, respectively.

Leading the pack for “most responsive” elected official on Twitter is Haverhill Mayor James Fiorentini, who replied to people on social media 136 times in the last 90 days, according to the data.

Fiorentini celebrated the unofficial ranking by replying to Abbett on Twitter.

“Fiorentini number 1!” he wrote, keeping in stride with the designation.

Weymouth Mayor Robert Hedlund, who came in fourth, joked that if the “Trump references and rants” were subtracted from the data, he’d be higher on the list.

Advertisement



As for “most talkative”? That title, according to Abbett’s methodology, belongs to Lawrence Mayor Daniel Rivera, who in the last 90 days tweeted a whopping 1,401 times.

In September, Lawrence was one of three communities in the Merrimack Valley rocked by a series of natural gas explosions and fires.

Since then, Rivera has been keeping people informed about restoration efforts by using Twitter.

Abbett, who created similar lists for state representatives and state senators, said he hopes his project inspires others to look at the data more in depth, or to create their own tables.

On Tuesday, he posted his open source code for the project to the GitHub code repository, so anyone can scrutinize it and come up with their own conclusions.

“I’d love to hear more ideas,” he said. “People who know this data better, if they have suggestions about what else to count or how to count it, or if anyone is interested in taking any of this data and doing something deeper with it, I’m happy to chat.”


Steve Annear can be reached at steve.annear@globe.com. Follow him on Twitter @steveannear. Milton J. Valencia of the Globe staff contributed to this report.