Today: Twitter closes at a new high for second day in a row, and Facebook, LinkedIn, Yelp and Groupon continue their weeklong surge. Also, Yahoo (YHOO) hits a six-year high, and Gilead slips.

Twitter hits new heights, Facebook is right behind

Investors continued to gave a thumbs-up to social media companies Tuesday, and Twitter continued to lead the mini-boom.

Twitter shares soared again, establishing a new record closing price for the second day in a row. After skyrocketing more than 9 percent Monday, the San Francisco-based microblogging company gained an additional 5.8 percent Tuesday, up $2.85 to close at $51.99, about double the price of its shares when it went public Nov. 7. Twitter is up 25 percent over the past five trading days, thanks largely to last week's announcement that it would target ads based on users' Web-browsing histories.

Twitter isn't the only social-media company on an upward trend. Facebook shares rose $1.40, or 2.88 percent, to $50.24 on Tuesday despite a glitch that tenporarily prevented users from updating their Timelines. Investors appeared excited about Facebook's future innovations following an announcement Monday that the Menlo Park company has hired Yann LeCun, a professor of computer science from New York University and a leading researcher in artificial intelligence. In a Facebook post, LeCun said he will lead the company's new research lab "with the ambitious, long-term goal of bringing about major advances in Artificial Intelligence."

LeCun's expertise is in speech- and image-recognition systems, according to a TechCrunch report, which could be applied to better facial recognition on photos and videos, and his background in "deep learning" could bring more personalized, intuitive content to Facebook's News Feed.

Facebook stock has risen almost 7 percent in the past week. In that period, Facebook has also announced the future addition of a "sympathize" button for when users post bad news -- though it says it will not launch a "dislike" button. It also joined Silicon Valley tech giants such as Apple (AAPL) and Google (GOOG) in appealing to President Obama and Congress to rein in the NSA's Internet surveillance efforts. And while a new survey on viral publishers Tuesday touted the successes of sites such as Buzzfeed and the Huffington Post, the overall numbers show just how dominant Facebook is in spreading viral stories -- despite last week's announcement that Facebook would favor "quality" news stories over memes in users' News Feeds.

LinkedIn, the Mountain View-based networking site, rose $2.17, or 0.92 percent, to $236.98, despite TheStreet's reaffirmation of its "sell" rating. "The company's weaknesses can be seen in multiple areas, such as its unimpressive growth in net income and disappointing return on equity," TheStreet analysts wrote. That opinion is far from the consensus though -- just Friday, BMO Capital Markets upgraded LinkedIn's price target to $270 from $235, based on its expected expansion into China next year, as well as further "monetization opportunities" in 2015. LinkedIn shares are up almost 9.5 percent over the past five days.

Long-beleagured San Francisco-based online gaming company Zynga jumped 14 cents, or 3.51 percent, to $4.13 on optimism from options traders that the stock would top $5 a share -- which would be a yearly high -- by January. Yelp, the San Francisco-based customer-review site, continued to rebound, rising $1.74, or 2.73 percent, to $65.53. Even struggling daily deals site Groupon participated in the social sector's bump: The Chicago company gained 4.37 percent, or 42 cents, to close at $10.04, after Morgan Stanley's Scott Devitt praised Groupon's long-term plans and predicted it is "on the path to become a unique mobile commerce marketplace at scale." In the past week, Yelp is up 4.6 percent, and Groupon almost 11 percent.

SV150 market report: Yahoo hits 6-year high, Gilead retreats from record high

The social sector's gains weren't enough to boost the Silicon Valley 150 index of the region's biggest companies. The SV150 posted slight losses for the day, in line with dips from the other major indexes. Silicon Valley's hardware sector took the brunt of the pain, with minor losses across the board, led by Oracle's (ORCL) 2.25 percent decline.

Gilead Sciences (GILD), the Foster City-based pharmaceutical giant, fell 3.17 percent, or $2.38, to $72.81, after critics assailed the high price of its hepatitis C drug, Sovaldi, which won FDA approval last week. That news had sent Gilead shares soaring to yearly highs Monday. The drug costs $1,000 a day -- $84,000 for a 12-week treatment course, a pricetag that a Doctors Without Borders representative calls "exorbitant."

Apple dipped 0.16 percent, or 88 cents, as investors took a wait-and-see approach on the expected deal with China Mobile, which R.W. Baird's William Power estimates could boost iPhone sales by as many as 30 million units. The deal is expected to be made official on Dec. 18.

Yahoo gained $1.35, or 3.47 percent, to close at $40.22, its highest point in more than six years, after RBC Capital Markets analyst Mark Mahaney boosted his price target from $38 to $44, based on Yahoo's stake in Chinese e-commerce giant Alibaba. Mahaney was encouraged by last month's "Singles Day' sales in China -- which generated twice the amount of online sales as Cyber Monday in the U.S. -- and stated optimism in CEO Marissa Mayer's long-term efforts to turn around Yahoo.

Up: Google, eBay (EBAY), Yahoo, Netflix (NFLX), Facebook, Zynga, LinkedIn, Twitter, Tesla

Down: Apple, Oracle, Intel (INTC), Cisco (CSCO), HP, Gilead, VMware, Juniper

The SV150 index of Silicon Valley's largest tech companies: Down 1.60, or 0.11 percent, to 1,4659.35

The tech-heavy Nasdaq composite index: Down 8.26, or 0.20 percent, to 4,060.49

The blue chip Dow Jones industrial average: Down 52.40, or 0.33 percent, to 15,973.13

And the widely watched Standard & Poor's 500 index: Down 5.75, or 0.32 percent, to 1,802.62

Check in weekday afternoons for the 60-Second Business Break, a summary of news from Mercury News staff writers, The Associated Press, Bloomberg News and other wire services. Follow Mike Murphy at twitter.com/mmmmurf.