Political ad TV party: Obama loves '2 Broke Girls.' Romney? 'Andy Griffith.'

Mitt Romney may or may not secure the presidency of the United States, but he appears to be in an optimal position to win Mayberry.

"The Andy Griffith Show" is the second-most Republican-leaning program in the country, as measured by the partisanship of the political ads that run during its episodes. Only the Olympics saw a higher percentage of Republican ads, according to a Yahoo News analysis of the filings reported to the Federal Communications Commission by the TV stations in the top 50 media markets.

Since August, the FCC has required stations in the top 50 markets to report all the political ads they air, giving us some sense of when and where campaigns and outside spending groups are spending their cash.

I analyzed the raw text of 14,000 of these filings and extracted about 50,000 individual records of a campaign, super PAC or party committee purchasing advertising time on a specific show. In the following interactive, you can browse through any of the 86 shows that came up at least 25 times in the sample. Click the buttons to go up or down through the shows, or use the bottom button to choose a show at random.

"2 Broke Girls" swung the most heavily to the Democrats—surprising, perhaps, given that the title evokes Mitt Romney’s message that the economy is floundering under President Barack Obama’s stewardship. (It is not surprising if you consider the subject: single women.) "Judge Joe Brown" came in second.

Unfortunately, the light of 10,000 suns could not completely disinfect the reams of raw democracy on where and when these ads are running. The FCC does not require stations to file the information in a way that’s useful to people armed with computers. We’re left with about 30,000 PDF files, totaling nearly 150,000 pages—many of which were scanned sideways or upside down. Nearly half the files could not be read by an optical scanner or could not reliably be connected to the group that ran the ads.

This makes it difficult to know the raw volume of money and airtime. But even a sample of the data gives us a tremendous amount of information about which audiences the campaigns and their surrogates most want to reach.

Thanks to the saintly work of ProPublica, which uploaded all of these files to a site called Document Cloud, we have the raw text of the documents. I used a computer script to extract the names of television shows from that raw text (at least the computer-readable parts). As usual, the numbing methodology is included below.

Because of the intrinsic chaos, we should not think of this data as a scientific sample of all political TV ad purchases. The volume of purchases in the sample does generally match figures from the Federal Election Commission, however: The two camps are advertising roughly in the same amounts, but the Democrats spend more through the campaign while the Republicans rely more on outside groups. Officials at the FCC warn that there is some risk of double counting in these documents, given that stations interpret what they have to disclose differently.

Maybe in 2016 they could use computers.

I used a Predictable Information Elimination algorithm to extract the names of TV shows from the documents, the (messy) source code for which is available on my GitHub page. Thanks again to ProPublica and the Sunlight Foundation, who have done a lot of work to reliably connect each document to the campaign or group paying for the airtime. When the same show turned up multiple times in one document, it was counted multiple times, since this almost always represents two discrete ad runs.

Chris Wilson can be reached at cewilson@yahoo-inc.com

  • Serena and Sharapova's 'black heart' rivalry
    Serena and Sharapova's 'black heart' rivalry

    The bitter rivalry between Australian Open finalists Serena Williams and Maria Sharapova took root on the hallowed Wimbledon turf in 2004 and is still thriving more than a decade later -- both on and off the court. The problem was, the fairytale victory that catapulted her to global celebrity came at the expense of Serena Williams -- top seed at the time and hot favourite for a third straight Wimbledon title -- a result that the American has never forgotten. It has spurred her on to an overall record of 16-2 against Sharapova, with the Russian's last victory over the world number one coming more than a decade ago. Since 2005, the American's winning streak is 15-0, including straight sets wins over Sharapova in the Australian and French Open finals (2007 and 2013), as well as the gold medal match at the 2012 London Olympics.

  • Australian Open finalist Serena Williams

    MELBOURNE, Jan 30 (Reuters) - Factbox on American Serena Williams, who will bid for her 19h grand slam title against Maria Sharapova at the Australian open on Saturday: Born in Michigan on September 26, 1981. (Age: 33) Seed: 1 GRAND SLAM CAREER: 18 - Australian Open (2003, 2005, 2007, 2009, 2010); French Open (2002, 2013); Wimbledon (2002, 2003, 2009, 2010, 2012); U.S. Open (1999, 2002, 2008, 2012, 2013, 2014) * Williams is tied for fourth on the list of female grand slam title winners. ...

  • Sharapova out to end decade of Serena dominance in Melbourne
    Sharapova out to end decade of Serena dominance in Melbourne

    Top seed Serena Williams' coach has dismissed the American's decade-long, 15-0 winning streak against Maria Sharapova as irrelevant ahead of the arch-rivals' blockbuster Australian Open final on Saturday. The final will pit the world's two best players, both in sizzling form, against one another in a dream Grand Slam decider, although the second seeded Sharapova faces questions over her staggering inability to notch a win over Williams since 2004. The Russian's overall losing record against Williams is 16-2, including a crushing straight sets win in the 2007 Australian final, and her last 15 meetings with the 18-time Grand Slam champion have ended in defeat. "Every sequence has to end, just ask Nadal," he told AFP, referring to Czech Tomas Berdych's quarter-final victory over Rafael Nadal this week to end a record-equalling 17-match losing streak against the Spanish great.

Follow Yahoo! News