SAN FRANCISCO – Charlie Hufnagel isn’t sure whether he wants an iPhone 5 when it goes on sale Friday, but that didn’t stop him from being first in line at the Apple store near Union Square. In fact, he’s been there since Monday morning — after all, he’s being paid for it.

Huge crowds and guaranteed media coverage have spawned a subculture of enterprising opportunists piggybacking off Apple hype. With the company set to release its highly anticipated iPhone 5, dozens of people are already gathered outside high-profile stores around the country.

But many are not there solely to buy the smartphone; they’re also hawking brands, blogs and products or looking to score some easy cash. All they have to do is wait in line.

In San Francisco, Hufnagel responded to a post on TaskRabbit, a website where users can outsource household tasks and errands, and agreed to wait in line at an Apple store for five days for $1,500. Once word got to TaskRabbit, employees dropped off a bunch of company apparel and signs that read: “#SkipTheLine with TaskRabbit.” Hufnagel — who set up a green REI tent, yoga mat and folding chair in front of the store — also made his own sign promoting his Twitter handle.

“The hours are weird, but I get to meet a lot of interesting people,” said Hufnagel, 24, an unemployed San Francisco resident. “I do feel a little like a zoo animal.”

And what kind of person would be willing to shell out hundreds of dollars to avoid waiting in line? “It seemed like an older guy who didn’t want the attention and publicity but wanted to be one of the first people to get his hands on a new iPhone,” Hufnagel said. “A guy with a lot of money.”

In New York, shoppers have been camped outside the Fifth Avenue store since Sept. 13, including Jessica Mellow, a face and body artist and model who is touting her blog, iPhoneWhatever.com, while wearing a shirt she got free of charge from Gazelle, a company that buys used electronics. Also in line: people promoting mobile banking app Refundo, and Apple line regular Hazem Sayed, who is using his No. 1 spot to get publicity for his social media app Vibe.

Last year, Sayed paid a college student $900 to take over her place at the front of the line for the iPad 2. His main motivation then was also to promote an app, AskLocal.

In a phone interview, Sayed, who has waited in three other Apple lines in the past, said the nature of waiting in front of the stores has changed over time, with more people these days selling their spots for cash, seeking buzz for their own companies or being sponsored by other brands. “It would be hard to get the same amount of publicity for a small company like we are in any other way,” the 54-year-old said. “It’s certainly worth the week of effort and the week of time.”

For others, it’s simply about the money. Hundreds of people have posted ads online offering to wait in line on Thursday night, usually for $100 to $150. The offers have been quickly snatched up, thanks to a large number of corporate executives and wealthy Apple fans who’d rather not sleep outside.

TaskRabbit, the San Francisco company that Hufnagel used to get his four-night, $1,500 gig, has been running its own iPhone 5 special. For $55, people can hire someone to wait in line for them for up to four hours at seven Apple store locations in the Bay Area or New York.

“You’ve waited long enough for the iPhone 5, why should you have to wait in line too?” the company said on its website. “A TaskRabbit will wait in line for you for up to four hours the morning of the release. Then you’ll swap places and buy your shiny new iPhone — it couldn’t be easier.”

The publicity stunts are an “interesting approach” for those who don’t mind the wait, said Eli Portnoy, a Los Angeles marketing expert. But he questioned whether it was effective.

“It doesn’t surprise me in this day and age that people are looking for a freebie way to get attention,” he said. “I’d say there are probably better ways to get low-cost publicity.”