Anthony Weiner can’t stop getting himself into trouble on social media.

The disgraced ex-congressman ignited a juvenile Twitter war with Gov. Andrew Cuomo on Thursday when Weiner poked fun at the governor’s decision last month to shut down the transit system Jan. 26 in preparation for the “blizzard” that wasn’t.

“Sunday’s gonna be cold. Governor Cuomo will soon be closing the subway,” tweeted Weiner, who in 2011 resigned in disgrace over a sext­ing scandal.

The governor’s staffers weren’t going to let Weiner’s crack pass, and fired back.

“Yes, it is going to be cold. A good reason to keep your pants on,” tweeted Cuomo spokesman Richard Azzopardi — a clear reference to Weiner’s penis-pic scandal, in which his political career came crumbling down ­after he was caught sending out images of his manhood to women other than his wife, Huma Abedin, a top aide to Hillary Rodham Clinton.

Weiner, of course, being an alleged grown-up, had to have the last word, shooting back with a tweet referencing the corruption probes sweeping Albany.

“I have to be careful ­responding. I don’t want to be accused of witness tampering,” he tweeted.

The Twitter war of words earned mixed reviews.

“@RichAzzopardi top tweet of the year regardless of what happens in the next 10 months!” wrote Twitter user Taryn Duffy.

Arthur Digby Sellers took Weiner’s side, telling Azzopardi, “Sick burn, be sure to share it with [US Attorney] Preet [Bharara] when your entire office gets indicted.”

Weiner’s original wintry swipe at Cuomo — who took heat last month when he shut down subways, buses and rails in advance of a blizzard that turned out to be a moderate storm — came after the governor brought up the sexting scandal.

When asked by The New Yorker if it’s fair for the governor to be held responsible for Albany corruption, Cuomo responded by saying, “If Anthony Weiner shows his private parts, do you blame Obama?”