By now many of you have seen the popular science fiction movie released in October, The Martian, starring Matt Damon. I’m sure that many of you have also read the bestselling book of the same name by Andy Weir on which the movie is based. But, I suspect, that many of you don’t know the story of Weir’s journey from aspiring author to publishing phenom.

Weir’s lifelong ambition was to become a published working science fiction author. In the late 1990s and early 2000s he wrote a couple of sci-fi novels and submitted them to multiple agents and publishers. He even took a couple of years off from working as a computer programmer to focus exclusively on his writing career. Unfortunately, he received rejection after rejection from both agents and publishing houses.

Weir went back to work as a programmer, but, undeterred, continued writing, posting his writing on his own blog at http://www.Galactanet.com.

His first success came when he posted the short story “The Egg” on the blog. The story went viral and Weir and his blog acquired a few thousand fans. (“The Egg” is well worth checking out, as are its several YouTube video adaptations.)

In 2009 Weir started posting chapters of his latest novel, The Martian, one at a time, on his blog. A few thousand readers became tens of thousands.

In 2012, at the urging of his fans he released the entire book as a Kindle ebook on Amazon for $0.99. In just a few months it shot to #1 on Amazon’s sci-fi list. Within the space of a few weeks in 2014 Weir was contacted by an agent, was offered book deal with Random House, sold the book and movie rights, and quit his day job to write full time.

Weir’s journey is, of course, yet another amazing testament to how fundamentally self-publishing has revolutionized the entire business of publishing, but it also contains a compelling lesson in marketing for all writers: Put your writing online and do so frequently.

Without Weir’s persistence in posting a variety of his writings online consistently over time “The Egg” might never have gone viral. Without “The Egg” going viral there might never have been enough readers of the first chapters of The Martian to push it to the next level of success.

Your next online article, blog post, blog comment, short story, vignette, recipe, or first chapter might be the egg which hatches your publishing success!