If there’s anyone who knows how to hack a travel deal, it’s DavidPhillips.

In 1999, the civil engineer from California catapulted into fame after he earned a whopping 1.2 million airline miles by taking advantage of a Healthy Choice mail-in promotion by purchasing a ridiculous amount of pudding.

Philipp’s deal execution was so epic, he became known as “The Pudding Guy” for years thereafter and even inspired the subplot for Adam Sandler’s character in the film “Punch-Drunk Love.”

His story nearly disappeared into the headlines of yore until last month when Business Insider published a follow-up video on Phillips’s genius hack, which reached more than 2 million views in three weeks. Turns out the pudding purchase was only the beginning of Phillips’s search for the best travel deals.

“I spent all the pudding miles in the first five years,” Phillips told The Huffington Post. “It wasn’t an unlimited supply.”

But it all started with 12,000 pudding cups.

Courtesy of David Phillips

According to Healthy Choice’s original 1999 promotion, participants could earn up to 1,000 travel miles to the airline of their choice for every 10 product barcodes they mailed back to the company. Phillips, recognizing the deal’s potential, scoured his town for the cheapest Healthy Choice products until he hit the jackpot: single pudding cups selling for 25 cents a piece.

With barcodes from more than 12,000 cups of pudding ― a total cost of $3,140 ― Phillips cashed in on more than 1.2 million miles. (Don’t worry, the extra food was donated to food banks.)

While he burned through his first million miles early on, Phillips continued to earn millions more doing things that even the most basic traveler could do. In the 17 years since he earned his airline mile fortune, Phillips has traveled to 43 different countries.

He’s taken his family, friends and even coworkers to spots around the world, including, but not limited to, Italy, Nicaragua, Austria, Aruba, the Netherlands, Korea, Colombia, Cambodia and Dubai.

“There are a lot of good sites on the Internet [to find these deals],” Phillips said. “I look through blogs and deal sites every day. To travel like I do, you have to have the experience of knowing, not just the deals that are posted, but their real values.”

Courtesy of David Phillips

Phillips currently has 2 million airline miles saved up ― and that’s on top of the million “pudding miles” he’s already used. But even with hefty mileage in the bank, he still pays for airfare out of pocket, if the deal is really good.

“One thing that people don’t expect is that I still buy tickets too,” he told HuffPost, adding that his purchases are what allow him to continue earning as many miles as he uses.

Now, after two decades of flight-searching and mile-earning, Phillips has practically mastered the art of the travel deal ― and you can too.

Below, follow The Pudding Guy’s best advice on how to earn and travel with an endless supply of airline miles.

1. Become a travel industry guru by studying travel blogs and deal sites.

If your travel searches stop at Google Flights, it’s time to expand your horizons. To better understand the travel trade, Phillips suggests reading frequent flyer bloggers who share their own tips and tricks on getting the most out of their airline miles and travel rewards, including sites like One Mile At A Time or View From The Wing. These insider blogs often publish explainers on how mileage programs work or how to take advantage of credit cards’ travel points systems.

“There’s just no substitute for educating yourself on mileage programs and how things works and what’s a good deal,” Phillips said. “Otherwise, you won’t recognize a good deal when it’s staring at you in the face.”

2. Be ready to purchase a last-minute deal. Don’t hesitate.

Since good deals come and go quickly, Phillips says it’s important to be open about buying a trip spontaneously, especially since “most of the really good opportunities aren’t around for a long time. For example, if there’s a flash sale for flights to Europe, don’t spend too much time thinking about whether you should pull the trigger on the deal. Similarly, if there’s a credit card with a sign-up bonus that offers thousands of miles, apply.

3. Be flexible with your travel calendar.

One of the easiest ways to find the best travel deals is to be flexible with your plans. “If you’re more flexible,” Phillips says, “there will be more opportunities.”

Phillips has found that having flexible travel dates tends to lead to better deals, since even the most popular destinations can be cheaper during their off-seasons. But if your dates are set in stone due to work or holidays, Phillips suggests traveling to an unexpected place.

4. Don’t always use your airline miles.

When you book a flight with airline miles, you won’t be eligible to earn new miles. For this reason, Phillips makes sure to book some of his travel with cash. If airfare is already cheap, evaluate the cost and potential rewards to figure out whether you should pay in cash or miles.

“Recently, I booked a trip from the west coast to Europe for $400,” Phillips explained. “It’s hardly worth it to use points because if I buy the $400, I’ll earn more miles with the travel.”

5. Check these websites daily.

If you want to book travel just like The Pudding Guy, make a bucket list of places you want to visit and check out the deal sites below. These are websites Philipps himself checks weekly and, when he’s not busy with work, daily.

One Mile At A Time or View From The Wing ― These are traveler blogs that post airline and hotel deals, as well as information on the mileage-earning system and travel points programs.

SecretFlying.com ― This is a deal website which posts daily airfare deals and discounts, including error fares posted by airlines and flash sales.

MommyPoints.com ― This is a mommy blogger who writes about airline miles and travel points. She posts airfare sales, mileage deals and hotel discounts.

DansDeals.com ― This is a general deals website which publishes deals and discounts on various products, including airfare and mileage-earning deals.