Joseph Brennan was not destined to be on this earth much longer and “he was in a lot of pain,’’ his daughter, Diane, recalled.

But “he had a little smile on his face’’ when she slipped on the head of her cancer-ravaged father his treasured Giants hat, newly signed by a punter named Steve Weatherford.

“He smiled when we put that hat on, it was quite amazing,’’ Diane Brennan recounted to The Post.

What is also quite amazing is how a simple act of kindness can find its way through cyberspace and the U.S, mail to resonate so deeply with, as Diane Brennan puts it, “a humble family’’ in Rhode Island that now keeps Weatherford in its blessings as it mourns a beloved husband, father and grandfather.

“The fact is, it took minimal effort from me,’’ Weatherford said. “Literally five minutes to sign this hat.’’

Here is the light to so much of the darkness intersecting athletes and social media, the self-promotion and self-absorption and nonsensical noise designed to drive players and fans closer and actually often does quite the opposite. Weatherford is an enthusiastic and avid participant, active on Twitter, Facebook and Instagram, as efficient with his iPhone 5 as he is knocking a football out of bounds. He’s been infamously once burned by his quick trigger finger, making him more cautious but only slightly less prolific.

“I know I’m not gonna play this game forever,’’ Weatherford told The Post during a training camp break. “I try to take advantage of the platform and the ability to inspire and motivate people because it’s not like it takes an hour and a half of my time to say ‘Hi’ to a kid or sign an autograph or share my motivation of the day on social media.

“Let’s be honest, I’m a punter. It’s not like I’m that big a part of the team. Granted I feel like I am talented at my position but the fact of the matter is I’m a punter, I play five or six plays a game. The fact people care what I think and I’m able to motivate people by being such a small piece of this team and still carry some weight off the field is cool. I think a lot of that is how accessible I make myself to fans. The fact is I really am living the dream and it’s cool I get to share the fact I’m living the dream with other people.’’

The Twitter king of the Giants, far and away, is Victor Cruz (@TeamVic) with more than 340,000 followers. Justin Tuck (@JustinTuckNYG91), the defensive captain, is next at nearly 175,000. Incredibly, Weatherford (@Weatherford5) is third with slightly more than 62,000 followers. Of course, if Eli Manning were so inclined he’d vault over them all but, alas, he’s not.

Chiseled and proud owner and operator of a bodybuilder’s physique, Weatherford, 30, looks more like a decathlete than a punter and his personality is high energy to the Nth degree. He posts and tweets pictures of his family in Halloween costumes, shares some of Tom Coughlin’s motivational words, spends up to 90 minutes in Twitter repartee on what he calls Weatherford Wednesdays, which he calls “really fan engagement day for me.’’

Seated behind Manning on the team bus to the airport for road games, Weatherford gets a kick out of posting pictures of the back of the franchise quarterback’s hair, often providing a review of the coiffe.

“Everybody loves Eli, he’s just a likeable guy,’’ Weatherford said. “I just tweeted it one time, just kind of caught on. It’s funny what gets trending on there.’’

Weatherford last summer thought his followers would get a kick of the video he took of Prince Amukamara getting lifted into the air by Jason Pierre-Paul and, with teammates howling in delight, getting dumped into a cold tub. Instantly, the images sparked a polarizing debate: Training camp antics vs. anti-social bullying. Weatherford, thoroughly embarrassed, had crossed a line as far as unveiling the inner sanctum and was rebuked by the team.

“Ninety-nine point nine percent of the tweets I make are positive, team building, motivational but every once in a while you make a mistake and tweet something like the cold tub video,’’ he said. “You take the good with the bad. I think I learned my lesson, before I do tweet things I double and triple check ’em. When I tweeted that I was like, ‘People think this is so funny’ but then if you sit back and think about it you can see how it can be offensive to some people. I have a little bit more trepidation with what I tweet. You do run the risk of making a mistake if you do use social media but if you’re able to handle it with some poise and maturity it can be a great tool.’’

Diane Brennan grew up a lifelong Giants fan because her father, Joseph, loved them even though he lived in Patriots country — Providence, R.I. Joseph Brennan told tales of Y.A. Tittle and Sam Huff, idolized Lawrence Taylor as a player, called Phil Simms “Twinkletoes.’’ A head custodian in the Providence school system, he attended only one Giants game in his life, back at the old Giants Stadium.

“Meager means, worked very hard all his life and provided very, very well for his family,’’ Diane Brennan said of her father.

On Facebook, Diane couldn’t help but notice the whirlwind of activity that was Steve Weatherford. “He just seems like such a caring person,’’ she said. “I don’t know, for some reason I just felt the need to [message] him. I can’t explain why.’’

Diane told Weatherford about her father, diagnosed with stage four lung cancer. She “kinda wanted to do something special for him’’ and asked Weatherford this: If she sent her father’s Giants hat, would he sign it and send it back?

“He contacted me right away and said whatever you want and I will get it back to you as soon as I can,’’ Diane recalled. Weatherford also offered to host Joseph Brennan and his family for a training camp visit but Joseph was too sick to make such a trip.

Diane Brennan received the signed hat on Friday, July 26. Also included was a warmly written note from Weatherford.

“My father had a really tough time, going in and out of it, times of hallucinations and stuff,’’ Diane said. “We put the hat on him and he smiled.’’

Joseph Brennan, 79, passed away Tuesday, July 30.

“Steve went way beyond what I ever could have imagined,’’ Diane Brennan said. “We’re such a humble family. My father’s a very humble man and for him to take time out of his busy schedule to do anything, we’re just average people, just fans that asked for a simple favor and he’s gone way beyond what we ever expected.’’

Weatherford, alerted about the death, took to his Facebook page to mention and salute Joseph Brennan. Diane’s three children, ages 17, 19 and 21, “were so engrossed by that all day that their grandfather was getting likes and tweets, it took their mind off of it for that brief moment,’’ she said.

Joseph Brennan was buried with a Giants helmet, wearing a favorite Giants T-shirt underneath his suit. The family members all wore Giants pins. Diane made sure a picture of Steve Weatherford and the hat he signed were on display at the funeral and the priest went out of his way to mention Weatherford’s kindness.

“I’m thinking to myself this literally took me five minutes and this guy’s lived for 79 years and I’m in his homily?’’ Weatherford said.

On Thursday, Diane Brennan, her son Christopher, daughters Caitlin and Meagan, husband David Page (“Unfortunately a Patriots fan, but we’re trying,’’ Diane says), her brother Joseph, sister Lynn and mother, Marilyn, will ride in from Cranston, R.I. to the Giants’ training facility and attend practice as guests of Weatherford.

“I’m probably going to cry,’’ Diane Brennan said. “I’m just going to give Steve a big hug and thank him. It just really has made this whole experience, it’s very bittersweet but it’s kind of taken our mind off what we’re going through. I think this is such a wonderful tribute to my dad.

“You hear so much negative about football players, you have Aaron Hernandez, you have all this stuff so negative about players. This person just went one step beyond. My father would not have known what Facebook, Twitter or Instagram was. We’re kind of laughing about that. You just picture him up in heaven walking around with this little swagger thinking ‘This is the greatest thing.’ ’’

paul.schwartz@nypost.com