The company powering Time Magazine’s Person of the Year poll has closed the loopholes used by two programmers and an army of 4chan users to manipulate it in favor of singer Miley Cyrus and whistleblower Edward Snowden.

The company, Poptip, eliminated the loopholes by early Wednesday morning, about a day after two programmers (a high schooler who calls himself Gains and a college student named Marek) rigged it in favor of Cyrus.

“They were IP banning every user capable of spamming the poll, including me,” Gains told me. “They also changed the [poll's] URL to http://www.poptip.com/_/poy/vote to http://www.poptip.com/_/poy/v0te in an attempt to stop us for a bit, and they also added Facebook authentication tokens in the voting process, which eliminates the possibility of voting for users on their behalf.”

The story of how Marek and Gains toyed with one of the world’s most respected news magazines began late Monday evening. That’s when I was invited to hop on a Skype call with the two programmers as they swapped code and decided on which public figure they wanted to win. They were creating scripts, dynamic programs that automated the vote casting process by working around Twitter and Facebook’s authentication.

By plugging a person’s Facebook ID number (which is public) into their scripts, the duo casted votes on behalf of that person without them knowing. The scripts also used threading, which essentially allowed them to cast multiple votes at once.

At about 10:45pm ET, Cyrus hovered around 15th place. She was right above Dzhokhar and Tamerlan Tsarnaev, the two brothers accused of bombing the Boston Marathon this spring. By 3am Tuesday, she was in fourth place. Leading the poll was Snowden, the favored choice among the Anonymous hacktivist collective and users of imageboard 4chan.

While Gains and Marek worked away on their scripts, 4chan’s random imageboard, /b/, and its technology board, /g/, had pieced together their own vote rigging methods (here’s one). By 9am Tuesday, Snowden had collected more than 45 percent of the vote.

“I thought it was over,” Gains told me. “That sadly, Marek and I failed in making Miley win the poll. We really thought that 4chan won this round and that there was no way we could recover from that.”

Over the next five hours, the Internet collectively cheered as Snowden, a former National Security Agency (NSA) employee responsible for leaking top secret documents, dominated.

“Snowden. No contest,” Reddit user goofproofacorn commented in one of the half dozen threads discussing his ascendance.

Then at 2pm something strange happened. Poptip stripped Snowden of thousands of votes. It resulted in him falling from first place. 4chan’s scheming ways had been discovered.

"Time and Poptip are aware of the efforts to affect the results of the Person of the Year poll, and have measures in place so that only legitimate votes are being incorporated in the final tally," a Time spokesperson told Mashable. "We're delighted that so many people are having fun with this informal poll and contributing to the conversation [about who should win]."

Gains and Marek saw this as the perfect opportunity. The duo switched to using public Twitter IDs in their scripts, which sped up the voting process. At 3:23pm, Cyrus reached the top of the poll. The two programmers could hardly believe it.

“People are mad about it, and people don't expect it,” Gains told me in a message. “It was our intention to make sure we didn't associate with 4chan's pranks this year. And the best part about this year is that one redditor who posted ‘2013: the year we learned 4chan < 2 programmers. Times change.’”

The celebration was short lived. By 1am Wednesday, Poptip had closed the loopholes. The scripts were useless. But it didn’t matter. Cyrus’s fans and the media were doing all the work for them.

The Huffington Post, Entertainment Weekly, BuzzFeed, and Computer World were just a few of the major news and entertainment organizations to report on Cyrus's march up the poll. Not to mention the thousands of fans tweeting about her. At 10 pm ET Wednesday, she had 28.3 percent of the vote.

Even Wikileaks invited its 2.1 million followers to join in on the fun.

The Time poll closes on Dec. 4 at 11:59pm. The winner will be announced on Dec. 6. This person will likely not be Time’s Person of the Year and instead will be crowned the Reader’s Poll winner.

That’s the title Time bestowed upon North Korean President Kim Jong-un last December after a group of 4chan and Anonymous members got hold of the poll.

It only took two days for Kim to collect 2.9 million votes at a rate of 6,000 every 10 minutes using a script. This group also spelled “KJU GAS CHAMBERS” by voting candidates like New Jersey Gov. Chris Christie to the top. President Barack Obama was named the magazine’s Person of the Year.

So will Cyrus ultimately win? Gains isn’t quite sure. It may take more than just some enthusiastic fans.

“If someone was still looking for an opportunity to rig the poll, they'll probably be forced to create and maintain a Facebook account creation script, which would work with the Poptip voting service,” Gains said. “But then you have to think, is it really worth [doing that] to rig one poll? We don't think it's worth it at all, so we're leaving it at that, unless we can find a new way to rig the poll. In the end, we still want Miley Cyrus to win.”

Illustration by Jason Reed