DEV Community

loading...
Cover image for Code Questions Bot

Code Questions Bot

vickilanger profile image Vicki (she/her) Updated on ・2 min read

Why build a tweeting bot?

It all started with a fleeting idea and a tweet. Wait, don't all projects start this way?

Liquid error: internal

So, with 80% of respondents giving a positive reaction to the idea, I started to plan the project.

I started thinking about the goals, why I was building it, and how it could have a big picture impact. So, here's the main goal:

Have fun & meet other devs while learning and helping each other learn.

There is a secondary piece. I want to make it easy for people to take their first steps into open source contributions. I included a section on contributing in the readme.md. This should make it a bit easier for someone new to contributing on GitHub.

GitHub logo VickiLanger / code-questions-bot

A Twitter bot who tweets code questions and trivia

Code Questions Bot made-with-python & Tweepy

contributions welcome Open Source Love png3

Maintenance open issues closed pull requests GitHub contributors

Follow on Twitter

Vicki wrote this about Building the Code Question Bot

Mission

Have fun & meet other devs while learning and helping each other learn.

Screeenshot of tweets by @codeQBot "What does API Stand for" and "What is exception handling? why use it?"

Contributing

If you would like to contribute, feel free to make a pull request.

First time? I suggest starting with adding a question to questions.py. Check out issue #5 for more details.

If you need more of a step-by-step, skim through this article about making your first contribution.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Who Has Contibuted?

All contributions are greatly appreciated.

image of contributors generated by https://contributors-img.web.app/ pulling from https://github.com/VickiLanger/code-questions-bot/graphs/contributors

Reference Stuff




Requirements

The bot was to be built with Python and Tweepy.
Previously, I made the Vets Who Code Bot. So, I already had some experience with Tweepy.

This bot was a little different because I was looking to update_status. I spent a lot of time trying to figure out how to do this and made it out like it was going to be super complex. It turned out to be a rather tiny piece of code that actually does the work.

api.update_status(question)
Enter fullscreen mode Exit fullscreen mode

Yup, that's pretty much it. There are a few other lines and some importing files to other files, but that's the statement that does the job.


What Next?

  • Work on automating this follow-up tweet that I've been putting on each question.
  • Add more questions
  • Write a Dev.to post detailing the steps to making open source contributions with GitHub

Links

Here's the Code Questions Bot

GitHub logo VickiLanger / code-questions-bot

A Twitter bot who tweets code questions and trivia

Discussion (2)

pic
Editor guide
Collapse
dmitrypolo profile image
dmitrypolo • Edited

I took a quick glance at the repository structure. One piece of advice I can give you right away is to add a .gitignore file to your repository to tell git which files it shouldn't track. You uploaded your __pycache__ to GitHub which doesn't belong there.

Collapse
vickilanger profile image
Vicki (she/her) Author

Oh. Thanks for letting me know. I will add the .gitignore and remove the pycache

I knew something looked weird