Dan Foley got his wish, but he’s finding out it’s not exactly a dream come true.

Since February, Foley has been on the current season of the CBS reality show “Survivor,” something he had been trying to do for 14 years. He had applied to the show about 100 times and drove thousands of miles to casting calls, exhibiting a tenacity admired by friends and family.

But after the April 8 episode, his eighth of the season, Foley learned how truly bad a bad night on reality TV can be. He was shown berating fellow contestant Shirin Oskooi, at one point saying that somebody should “slap” her.

Fans of the show immediately took to Twitter to call Foley’s behavior “truly repugnant” and Foley a “disgusting pig,” among other things. On Friday, two days later, the sting of the Twitter critics was still fresh as he scrolled through some of the harsher Tweets on his phone during a break from his electrician’s apprentice job.

“I feel like I rubbed the genie’s lamp and got my wish, but my wish wasn’t well-worded,” said Foley, 48, of Gorham, who stopped short of saying he regretted being on the show. “I spent so much time thinking about playing the game, I didn’t give other things a lot of thought.”

Like how his offhand comments, made in the heat of trying to win $1 million, might sound on TV after editing.

Friends and family say that the man “Survivor” viewers are seeing is not the Foley they know. They say it’s not the guy who, as a landlord, can be over at a moment’s notice to fix a leaky faucet, and who invites tenants to his home for game nights. Or the man who talks glowingly about his experience growing up as an adopted child, and who has gone out of his way to help friends with adopted kids. Or the Foley who works seven days a week at two jobs, fixing mail processing machines for the postal service and apprenticing as an electrician.

“It’s been hard to watch. It’s very strange to see him portrayed that way. He’s a great friend to his tenants, the most welcoming guy you could meet,” said David Delano, a 25-year-old music teacher who has rented an apartment in one of Foley’s two apartment buildings for six years. “It is sort of a cautionary tale of what can happen on reality TV. We all say silly things, or things on a whim, but on TV it can look like someone says those things all the time.”

DRAMA, SELECTIVE EDITING, APOLOGY

Foley has been on this season of “Survivor” since it began Feb. 25 with 18 contestants. Despite the name, the show is more about playing games – “challenges” set up by the producers and mind games with fellow castaways. Winning the challenges brings special benefits and immunity from tribal council votes. At the end of each episode, one person is voted off the show at a tribal council. So convincing people to support you, and vote against others, is a big part of the competition.

The current episodes were filmed during 39 days in Nicaragua last August and September, but the show’s winner will not be crowned until May 20. So Foley knows much of what will happen in future episodes, but is not allowed to share those details yet.

What Foley won’t know when the next episode airs, at 8 p.m. Wednesday, is exactly how he’ll be portrayed or how people will react to it.

Foley has been upset by what he sees as selective editing. For instance, he said that as a preface to his comments about Oskooi, he mentioned that often in movies when someone is hysterical, someone else has to slap the person to bring them back to reality. That’s the kind of slapping he was talking about, Foley said. But his setup for the remark was not in the episode that aired.

Hali Ford, who was voted off that April 8 episode of “Survivor,” said in her exit interviews that Oskooi had been “a victim of domestic violence.” Ford said in printed accounts that she watched the episode with Oskooi, who was “tearful.”

Foley said he had no way of knowing Oskooi’s personal history and apologized to her on Twitter, saying, “Shirin, there r no words to express how sorry I am about my cruel words.”

Although he has been criticized, Foley also has been celebrated. Fans and friends, sometimes as many as 200, gather every Wednesday night at local restaurants to watch “Survivor” with Foley and cheer him on. People who recognize him on the street wish him well or ask to get their pictures taken with him.

He’s also been celebrated by some “Survivor” fans for helping to add some of the melodrama that is one of the show’s hallmarks.

Rob Cesternino, co-host of a Web series called “Survivor Know-It-Alls,” said after the April 8 episode that he was glad Foley did not get voted off because he’s been so “fantastically terrible.”

“As a viewer, I was not ready to let go of Dan. He’s given us a lot of gold this season,” Cesternino said on his Web series.

The show itself is celebrating Foley with a wry video on the CBS website titled “The Dan Foley School of Survivor.” It shows clips of Foley saying things that make him appear insensitive. In one, he says a person can either “listen like a guy” by trying to figure out how to make things better, or “listen like a girl” by nodding their head and agreeing. Then he’s shown using that very technique on a woman on the show.

In another clip, Foley is seen trying to apologize to fellow contestant Sierra Thomas, followed by her calling it “the crappiest apology” she had ever received. Yet Thomas traveled to Maine in March to attend one of Foley’s viewing parties and called him her “snuggle buddy” for helping to keep her warm at night.

Peter Dudar, a co-worker of Foley at the postal service, admires his persistence. Dudar remembers back in 2000 when Foley became fascinated with the show and made it his goal to get on it. He and Foley would go to Denny’s for a meal and try to think up audition videos.

Year after year, through all the rejections, Foley kept trying. Dudar said watching his friend’s dedication to the task was “inspirational.”

On his official “Survivor” cast bio, Foley said that part of the reason he thought he’d do well on the show was because he is “a world-class ‘schmooze’ artist” who “can charm my way out of almost anything.” He also said, “I am not above taking the rules of fair play in a spirited competition and grinding them to dust beneath my heel.”

But Dudar said Foley wasn’t so single-minded in his “Survivor” quest that he didn’t have time to help friends. Foley, who grew up as one of four adopted children, stepped up to help Dudar and his wife when they adopted their two children.

“Moral support, errands, rides to the airport, whatever we needed he was there,” said Dudar, 43, of Lisbon Falls.

SHOW OVERLOOKS FOLEY’S TENDER SIDE

Foley’s wife, Erin, said her husband is the kind of person who goes out of his way to help people. This past winter, while they were in a hurry to get somewhere, Erin Foley said her husband stopped his truck to help some people pull their stuck car out of the snow.

She said her husband often invites people to stay at their home. One of Foley’s tenants, who was having trouble with roommates, ended up living with the Foleys for about six months, she said.

Foley’s tender side is not seen on “Survivor,” although he contends he displayed it for the cameras. Foley said he spent most of one day during filming missing his wife, and crying, because it was their wedding anniversary. But none of those moments made the show.

He has been seen as a bit self-deprecating, calling himself “a fat guy” several times, and saying that he knows sometimes he has trouble keeping his mouth shut.

Erin Foley said one of the things she loves about her husband is his honesty and frankness. But those are qualities that could account for some of his comments on TV.

“You always know where you stand with Dan. He never says one thing and thinks another,” she said. “On the show, you’re not hearing him talk about his positive feelings for people. If he thinks you’re full of BS, he’ll tell you that, man or woman. If he loves you, you’re really going to know it.”

Send questions/comments to the editors.