BOSTON — Joe Kelly was sitting in the trainer’s room in San Diego with former Boston Red Sox catcher A.J. Pierzynski on Thursday, scrolling through Twitter on his phone, when some interesting news popped up in his timeline.

“Hey,” the then-St. Louis Cardinals pitcher said to Pierzynski. “It looks like the Cardinals are going to get (John) Lackey.”

“Oh, yeah?” Pierzynski replied. “How do you know?”

“I’ve got a source on Twitter,” Kelly said.

“Right,” Pierzynski responded dismissively. “Because everything on Twitter’s true.”

Kelly recounted the conversation Saturday from the home clubhouse at Fenway Park, which is now his baseball home after the trade deadline deal that sent Kelly and outfielder Allen Craig to the Red Sox for Lackey and minor league pitcher Corey Littrell. Kelly, a 26-year-old right-hander, actually found out he had been traded via social media before Cardinals manager Mike Matheny broke the news to him in person.

“Media this day and age, it’s very fast,” Kelly said. “(The last three days) have been definitely hectic. It’s something that happens in baseball, and as they say, it can happen to anyone. When I got the news, I was definitely shocked and surprised, but I found out it was Boston and I figured it was one great baseball town to another.”

The trade was the latest twist in a challenging season for Kelly. He spent three months on the disabled list with a strained hamstring that flared up during his rehabilitation and delayed his return to the Cardinals. He is 2-2 with a 4.37 ERA this season after going 10-5 with a 2.69 ERA last season. He started the Cardinals’ Game 3 win over the Red Sox in the World Series, taking a no-decision.

Kelly has been mostly healthy and back in the bigs since July 11, however, and is now being counted upon to add some stability to an unproven Red Sox pitching staff. His first start in a Red Sox uniform is scheduled to come next week in St. Louis, of all places.

Facing his former team so soon after a trade will be “a little weird” but fun, Kelly said. And fun is something he looks to bring to any game he plays in.

“I like to have fun playing the game of baseball, good or bad,” Kelly said. “Baseball’s ultimately a game. I love winning, but I just like going out there, have a smile on my face and just be relaxed. When you’re having fun, you usually tend to play the game a little bit better than when you’re not having fun.”

Wise words indeed, but don’t give Kelly too much credit for them. He probably read them somewhere on Twitter.