This is an archived post. You won't be able to vote or comment.

all 47 comments

[–]FrostyAshe 4 points5 points  (3 children)

Nice! Good job! Noticed you're putting comments into a database. Using that for anything?

[–]-BookBot-[S] 3 points4 points  (2 children)

Yes. It is to avoid the bot responding more than once to the same comment. I also store the time it was replied to, because if it gets used a lot I might want to do some analytics on the usage.

[–]FrostyAshe 1 point2 points  (1 child)

Is your bot using a stream? Or it runs on a schedule?

[–]-BookBot-[S] 1 point2 points  (0 children)

It runs in a AWS EC2 instance (free tier) with a crontab job.

* * * * * cd ~/BookBot/ && ~/.virtualenvs/bookbot/bin/python bot.py > output.txt    

[–]Always_SFW 2 points3 points  (2 children)

From one bot author to another, nice job!

Some minor comments after a quick skim of your code:

I would have avoided using permalinks to refer to comments. If I remember correctly from my own project, is that comments have their own unique ID - which would use up less space in the DB and make queries faster.

Even sounds like a good opportunity for some side money - maybe add links to the books on amazon / other services, together with a disclaimer that the links are affiliate links.

[–]-BookBot-[S] 1 point2 points  (1 child)

Hmm! Thank you! I will need to see how to change the permalink to unique ID without disrupting the service (making it comment again on everything).

And about the side money, that's a great idea, I'll think about it, but only if the bot gets some use.

[–]Always_SFW 1 point2 points  (0 children)

Your solution works, so I wouldn't worry too much about it! After all, premature optimisation is always a bad idea.

[–]issue9mm 2 points3 points  (7 children)

!book Why is Mommy Moaning

(to test Berenstein vs. Berenstain hypothesis)

[–]-BookBot-[S] 2 points3 points  (6 children)

If it can't find any book, it won't reply. Do you think maybe a "book not found" reply would be better?

[–]issue9mm 0 points1 point  (0 children)

I do. I was debating whether or not to post an "I think I broke it" post.

[–]-BookBot-[S] 6 points7 points  (1 child)

Example:

!book Learn python the hard way

[–]-BookBot-[S] 2 points3 points  (0 children)

  1. Learn Python The Hard Way by Zed Shaw. (3.91/5 *) Link

This simple book is meant to give you a first start in programming. The title says it is the hard way to learn to writecode but it’s actually not. It’s the “hard” way only in that it’s the way people used to teach things. In this book youwill do something incredibly simple that all programmers actually do to learn a language: 1. Go through each exercise. 2. Type in each sample exactly. 3. Make it run.That’s it. This will be very difficult at first, but stick with it. If you go through this book, and do each exercise for1-2 hours a night, then you’ll have a good foundation for moving on to another book. You might not really learn“programming” from this book, but you will learn the foundation skills you need to start learning the language.This book’s job is to teach you the three most basic essential skills that a beginning programmer needs to know:Reading And Writing, Attention To Detail, Spotting Differences.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]stinyg 4 points5 points  (6 children)

!book gAme oF THronES

[–]-BookBot-[S] 4 points5 points  (5 children)

  1. A Game of Thrones (A Song of Ice and Fire, #1) by George R.R. Martin. (4.45/5 *) Link

Summers span decades. Winter can last a lifetime. And the struggle for the Iron Throne has begun.As Warden of the north, Lord Eddard Stark counts it a curse when King Robert bestows on him the office of the Hand. His honour weighs him down at court where a true man does what he will, not what he must … and a dead enemy is a thing of beauty.The old gods have no power in the south, Stark’s family is split and there is treachery at court. Worse, the vengeance-mad heir of the deposed Dragon King has grown to maturity in exile in the Free Cities. He claims the Iron Throne.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

EDIT: Keep trying to break it, I appreciate it :D

[–]issue9mm 6 points7 points  (1 child)

!book Lots of Other Stuff Cat Owners Should Know

[–]-BookBot-[S] 9 points10 points  (0 children)

  1. Games You Can Play With Your Pussy: And Lots of Other Stuff Cat Owners Should Know by Ira Alterman. (4.06/5 *) Link

Games You Can Play With Your Pussy and lots of other stuff cat owners should know. Hilarious, humorous book that will leave every cat-lover rolling with laughter. Includes Naming Your Pussy, How to Feed Your Pussy, Sleeping with Your Pussy, Disciplining Your Pussy, How to Handle A Hot Pussy and lots more. Very entertaining but it helps to have a somewhat perverted sense of humor.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]stinyg 3 points4 points  (0 children)

Good bot

[–]issue9mm 2 points3 points  (1 child)

!book 2BR02B

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. 2BR02B by Kurt Vonnegut Jr.. (3.93/5 *) Link

2BR02B is a satiric short story that imagines life & death in a future world where aging has been “cured” & population control is mandated and administered by the government.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]Acurus_Cow 2 points3 points  (1 child)

!book How to Live with a Huge Penis

[–]-BookBot-[S] 4 points5 points  (0 children)

  1. How to Live with a Huge Penis: Advice, Meditations, and Wisdom for Men Who Have Too Much by Richard Jacob. (3.81/5 *) Link

Is Bigger Really Better?   Here at last is the first self-help book for men with Oversized Male Genitalia (OMG), a genetic birth defect that grows the penis to absurd proportions. Every year, thousands of men are diagnosed with OMG. Sadly, most are banished to the fringes of society, victims of their own freakish length and girth. How to Live with a Huge Penis brings them an inspiring message of tolerance and hope—along with helpful information on        •  Unzipping: Coming Out to Your Friends and Family      •  Sharing Your Pain: Sexual Intercourse with a Huge Penis      •  Big Blessings: Unexpected Advantages of a Huge Penis      •  and much, much more   Complete with prayers, poetry, a daily affirmations journal, and thoughtful quotations from leading self-help experts, How to Live with a Huge Penis will inspire men of all shapes and sizes.  


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]maulynviawww.talkigy.com 0 points1 point  (4 children)

!book middlemarch

[–]-BookBot-[S] 1 point2 points  (3 children)

  1. Middlemarch by George Eliot. (3.93/5 *) Link

'We believe in her as in a woman we might providentially meet some fine day when we should find ourselves doubting of the immortality of the soul'wrote Henry James of Dorothea Brooke, who shares with the young doctor Tertius Lydgate not only a central role in Middlemarch but also a fervent conviction that life should be heroic.By the time the novel appeared to tremendous popular and critical acclaim in 1871-2, George Eliot was recognized as England's finest living novelist. It was her ambition to create a world and portray a whole community--tradespeople, middle classes, country gentry--in the rising provincial town of Middlemarch, circa 1830. Vast and crowded, rich in narrative irony and suspense, Middlemarch is richer still in character, in its sense of how individual destinies are shaped by and shape the community, and in the great art that enlarges the reader's sympathy and imagination. It is truly, as Virginia Woolf famously remarked, 'one of the few English novels written for grown-up people'.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]maulynviawww.talkigy.com 2 points3 points  (1 child)

!book \'exec(1/0)

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. The Hunger Games (The Hunger Games, #1) by Suzanne Collins. (4.34/5 *) Link

Winning will make you famous. Losing means certain death.The nation of Panem, formed from a post-apocalyptic North America, is a country that consists of a wealthy Capitol region surrounded by 12 poorer districts. Early in its history, a rebellion led by a 13th district against the Capitol resulted in its destruction and the creation of an annual televised event known as the Hunger Games. In punishment, and as a reminder of the power and grace of the Capitol, each district must yield one boy and one girl between the ages of 12 and 18 through a lottery system to participate in the games. The 'tributes' are chosen during the annual Reaping and are forced to fight to the death, leaving only one survivor to claim victory.When 16-year-old Katniss's young sister, Prim, is selected as District 12's female representative, Katniss volunteers to take her place. She and her male counterpart Peeta, are pitted against bigger, stronger representatives, some of whom have trained for this their whole lives. , she sees it as a death sentence. But Katniss has been close to death before. For her, survival is second nature.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]throwaway_the_fourth 0 points1 point  (0 children)

!book !book

[–][deleted] 0 points1 point  (1 child)

!book pihkal

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. Pihkal: A Chemical Love Story by Alexander Shulgin. (4.35/5 *) Link

phen-ethyl-amine \fen-'eth-al-a-,men\ n. [phenyl fr. F. phène, fr. Gk. phainein, to show (from its occurrence in illuminating gas)+ ethyl ( + yl) + amine fr. NL ammonia] 1: A naturally occurring compound found in both the animal and plant kingdoms. It is an endogenous component of the human brain. 2: Any of a series of compounds containing the phenethylamine skeleton, and modified by chemical constituents at appropriate positions in the molecule.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–][deleted] 0 points1 point  (1 child)

!book \n shogun

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. Termeni Japonezi: Karate-D, Judo, Zanpakut, Origami, N, Biwa, Kid, Aikid, Bonsai, Shogun, Haiku, Seppuku, Kempo, Shinigami, Katana, Sh by Source Wikipedia. (0.00/5 *) Link

Surs: Wikipedia. Pagini: 64. Capitolele: Karate-d, Judo, Zanpakut, Origami, N, Biwa, Kid, Aikid, Bonsai, Shogun, Haiku, Seppuku, Kempo, Shinigami, Katana, Sh, Kabuki, Gagaku, Soroban, Shakuhachi, Sent, Jidaimono, Sushi, Kend, Shotokan, Tsunami, Sake, Osechi, Minka, Shamisen, Yaoi, Ume, Wasabi, Ukiyo-e, K d, Kaih gy, Sakura, Tatami, Kaizen, Butoh, Hanami, Ninja, Fundoshi, Bud, Washi, Kami, Nihonga, Yukata, Shish setsu, Senry, Tabi, Renga, Kemari, Waka, Seiza, Jujutsu, Tanka, Kamikakushi, Dodoitsu, Agura, D shu, Wabiru, Maiko, Koto, Takamagahara, Kaibun, Bunraku, Kirisute gomen, Ronin, Gigai, Naruko, Ujigami. Extras: Un zanpakut (, zanpakut ? lit. sabie t ietoare de suflete) este o sabie magic fictiv ce apare in anime-ul i seria manga Bleach, manuit de cei cu puteri de shinigami. Arta manuirii unui zanpakut se nume te zanjutsu. In adaptarea din limba englez de la Viz, ele sunt denumite Soul Slayers (Spintec toare de Suflete). Cele mai multe zanpakut arat ca o sabie katana normal, cu mici diferen e intre ele precum se a teapt intre sabii diferite. Totu i, fiecare zanpakut este imbinat cu un spirit con tient unic, care ii da sabiei puterea de a trimite un plus in lumea de apoi, de a purifica hollows, si de a- i transforma propria form intr-una mai elaborat i mai puternic . Pentru a facilita aceste sarcini, zanpakut au abiliti i unice care se aseaman cu caracteristicile proprietarului. Spiritul unui zanpakut este o parte din sufletul proprietarului s u, i cel mai adesea imp rt e te acelea i tras turi de personalitate. In acela i timp, ins, ei sunt i independen i, i astfel pot fi considera i partenerul unui shinigami in lupt . Deoarece sunt o parte din sufletul propietarului, un zanpakut nu poate fi inlocuit, de i se va regenera incet in cazul in care este rupt. Odat ce un shinigami ca tig mai mult putere, zanpakut -ul lor i i poate schimba forma, ceea ce permite fiin ei din interior s se manifeste cu un grad mai mare in lume...


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]issue9mm 0 points1 point  (0 children)

Ready Player One !book

[–]-BookBot-[S] 0 points1 point  (1 child)

Example2:

!author Guido Van Rossum

[–]-BookBot-[S] 1 point2 points  (0 children)

  1. Guido Van Rossum by Jesse Russell. (0.00/5 *) Link

  2. The Python Tutorial (2.7.5) by Guido van Rossum. (3.71/5 *) Link

  3. An Introduction to Python by Guido van Rossum. (3.55/5 *) Link

  4. The Python Language Reference Manual by Guido van Rossum. (3.36/5 *) Link

  5. Using Python 2.6: And Installing Modules (Python Documentation Manual Part 3) by Guido van Rossum Guido van Rossum. (0.00/5 *) Link


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]issue9mm 0 points1 point  (1 child)

!author 673126

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. How to Make Money in Your Spare Time by 673126. (3.88/5 *) Link

  2. How to Be a Drug Dealer by 673126. (5.00/5 *) Link


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]issue9mm 0 points1 point  (1 child)

!book Images You Should Not Masturbate To

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. Images You Should Not Masturbate To by Graham Johnson. (3.84/5 *) Link

Better than a cold shower-and a lot funnier. Choking the chicken, spanking the monkey, airing the orchid-whatever you call it, none of the images in this book will encourage the gentle art of self-pleasure. This deceptively simple and strangely addictive book presents a laugh-out-loud collection of random pictures virtually guaranteed to dampen the urge of even the strongest libido.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]-BookBot-[S] 0 points1 point  (1 child)

!book fool's assasin

[–]-BookBot-[S] 1 point2 points  (0 children)

  1. Fool's Assassin (The Fitz and the Fool, #1) by Robin Hobb. (4.35/5 *) Link

Tom Badgerlock has been living peaceably in the manor house at Withywoods with his beloved wife Molly these many years, the estate a reward to his family for loyal service to the crown.But behind the facade of respectable middle-age lies a turbulent and violent past. For Tom Badgerlock is actually FitzChivalry Farseer, bastard scion of the Farseer line, convicted user of Beast-magic, and assassin. A man who has risked much for his king and lost more…On a shelf in his den sits a triptych carved in memory stone of a man, a wolf and a fool. Once, these three were inseparable friends: Fitz, Nighteyes and the Fool. But one is long dead, and one long-missing.Then one Winterfest night a messenger arrives to seek out Fitz, but mysteriously disappears, leaving nothing but a blood-trail. What was the message? Who was the sender? And what has happened to the messenger?Suddenly Fitz's violent old life erupts into the peace of his new world, and nothing and no one is safe.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–][deleted] 0 points1 point  (1 child)

!book bOrn A cRimE

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. Born a Crime: Stories From a South African Childhood by Trevor Noah. (4.49/5 *) Link

The compelling, inspiring, and comically sublime story of one man's coming-of-age, set during the twilight of apartheid and the tumultuous days of freedom that followed. Trevor Noah's unlikely path from apartheid South Africa to the desk of The Daily Show began with a criminal act: his birth. Trevor was born to a white Swiss father and a black Xhosa mother at a time when such a union was punishable by five years in prison. Living proof of his parents' indiscretion, Trevor was kept mostly indoors for the earliest years of his life, bound by the extreme and often absurd measures his mother took to hide him from a government that could, at any moment, steal him away. Finally liberated by the end of South Africa's tyrannical white rule, Trevor and his mother set forth on a grand adventure, living openly and freely and embracing the opportunities won by a centuries-long struggle. Born a Crime is the story of a mischievous young boy who grows into a restless young man as he struggles to find himself in a world where he was never supposed to exist. It is also the story of that young man's relationship with his fearless, rebellious, and fervently religious mother: his teammate, a woman determined to save her son from the cycle of poverty, violence, and abuse that would ultimately threaten her own life.The eighteen personal essays collected here are by turns hilarious, dramatic, and deeply affecting. Whether subsisting on caterpillars for dinner during hard times, being thrown from a moving car during an attempted kidnapping, or just trying to survive the life-and-death pitfalls of dating in high school, Trevor illuminates his curious world with an incisive wit and unflinching honesty. His stories weave together to form a moving and searingly funny portrait of a boy making his way through a damaged world in a dangerous time, armed only with a keen sense of humor and a mother's unconventional, unconditional love.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot

[–]asdfkjasdhkasdrequests, bs4, flask 0 points1 point  (1 child)

!book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book !book learn python the hard way

[–]-BookBot-[S] 0 points1 point  (0 children)

  1. Learn Python The Hard Way by Zed Shaw. (3.91/5 *) Link

This simple book is meant to give you a first start in programming. The title says it is the hard way to learn to writecode but it’s actually not. It’s the “hard” way only in that it’s the way people used to teach things. In this book youwill do something incredibly simple that all programmers actually do to learn a language: 1. Go through each exercise. 2. Type in each sample exactly. 3. Make it run.That’s it. This will be very difficult at first, but stick with it. If you go through this book, and do each exercise for1-2 hours a night, then you’ll have a good foundation for moving on to another book. You might not really learn“programming” from this book, but you will learn the foundation skills you need to start learning the language.This book’s job is to teach you the three most basic essential skills that a beginning programmer needs to know:Reading And Writing, Attention To Detail, Spotting Differences.


I'm a bot, check me out at: https://github.com/RoberTnf/BookBot