FORMER Fianna Fail TD for Dublin South East Chris Andrews has quit the party after being unmasked as the Twitter user @brianformerff -- who posted more than 300 tweets, many highly derogatory of the party leader Micheal Martin and other senior Fianna Fail figures.

In an exclusive interview with the Sunday Independent, Mr Andrews cited disenchantment with Mr Martin and the party's lack of direction for his decision to quit the party his grandfather Todd Andrews helped to establish, and in which his father Niall and uncle David Andrews were influential figures for decades.

But his decision to leave the party came as details emerged of an extraordinary and sophisticated sting operation which revealed his identity as the Twitter account user @brianformerff.

As well as the party leadership, the Twitter account controlled by the former TD singled out constituency rival, Fianna Fail councillor Jim O'Callaghan -- brother of RTE's Miriam O'Callaghan -- for anonymous attacks. Mr O'Callaghan is legal adviser to Fianna Fail.

A 35-page dossier -- detailing how an individual used surveillance and counter espionage techniques, including video surveillance, to unmask @brianformerff -- arrived at the Sunday Independent last week.

When approached with details of the dossier, Mr Andrews confirmed that he was responsible for the tweets posted on the account @brianformerff and admitted the anonymous account was set up by him and a "small group of like-minded individuals" who were supporters of Fianna Fail disenchanted with the party.

"I take full responsibility for it. It was the wrong thing to do. I regret doing it. For someone who is generally outspoken and not afraid to speak out, I regret that I did not say things publicly six months ago," he said.

The tweets Mr Andrews now admits sending were generally scathing of his party. They included: "@randomirishnews Labour have sold out and FF have proven to be incompetent and a large number of them dishonest at the top of the party."

Another tweet read: "@lawlessj FF will never recover while current leadership is there. People like S Donnelly are future."

Fianna Fail leader Micheal Martin also came under further attack from @brianformerff: "@oliverpgolden Martin was mentioned in #mahon so how can he still claim that he should be leader."

Another read: "FF should take Noel Whelan's advice and close up shop and get rid of hierarchy like willie O'Dea, martin, dorgan and start fresh."

The dossier, which reads like an espionage novel, details how the author suspected as far back as last March that the Twitter account holder @brianformerff, who was responsible for sending derogatory messages about his wife, was in fact Chris Andrews.

He then spent months tracking down the identity in what almost became a personal crusade and used ingenious IT techniques.

The author used a third party service called SnapBird.org which records every tweet posted indefinitely, even after they have been deleted.

He used SnapBird to recover a complete transcript of @brianformerff tweets which included messages sent in response to tweets posted by a range of newspaper and broadcast journalists, RTE and Newstalk Twitter accounts.

He discovered that each tweet had originated from the Twitter web interface, meaning it had been posted from a web browser on a computer, rather than sent from a mobile phone or other portable device.

Based on the times that tweets were posted by @brianformerff, he deduced that the Tweets were being posted while the user was on a work break, using a company computer or an internet cafe.

The next stage in the hunt was uncovering the IP address of the computer where the tweets originated.

"I created my own web redirection service which would allow me to take links to articles of interest, for example in the Irish Times, and then transform them into short links that would pass through a redirection server I controlled. In this way, if someone read the tweets and clicked on the link, I would be able to establish the IP address of the computer that was being used at the time."

The author created a new twitter account, @john_cant _type, based on the persona of a politics student based in Kildare. He started sending several messages and tweets to "brian" and other users to establish himself as a genuine twitter user.

Eventually @brianformerff responded to a post from @john_cant_type to a link to an article at Silicon Republic. The bait was taken and the IP address was tracked to an internet cafe, Amazon cyber/net Rathmines which offers web access "at the very reasonable rate of €1/hour".

What happened next descended almost into the realms of farce. The author waited for tweets from @brianformerff and then rushed to the internet cafe to try and catch Chris Andrews. Eventually the plan worked and the author used photography and video surveillance, even taking covert photographs of tweets as they were being posted in the internet cafe by Chris Andrews and analysing if the word count and structure matched the tweets appearing in cyberspace under the tag @brianformerff.

They did.

Mr Andrews said his decision to quit the party began to form in his mind even before the last general election and the decision to send in a formal latter of resignation last week was not linked to the Twitter embarrassment.

"I have been deeply frustrated by the direction, or lack of it that the party has taken. There were other issues as well, including the treatment of Brian Crowley in relation to the presidency, which was a disgrace," he said.

Sunday Independent