Giter Site home page Giter Site logo

pingpong's Introduction

PingPong

PingPong is a Twitter bot (let's say: @your_bot) that replies "pong" whenever someone mentions "@your_bot" in a tweet that contains "ping", "Ping" or "PING".

You can test it by posting "ping @E_Dmz_Bot" on Twitter.

Please visit https://twitter.com/E_Dmz_Bot and https://twitter.com/E_Dmz for more.

[🧡 Code] PingPong 🤖 is a bot that replies "pong" whenever someone mentions me in a tweet that contains "ping".#Python #cron #twitterapi
Source code is here ⤵️https://t.co/sWjYub3fv8

— E-Dmz bot (@E_Dmz_Bot) July 12, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Prequisites

Installation

1. Clone repo

git clone https://github.com/E-Dmz/PingPong.git

2. Manage your keys

Modify keys_template.py with your own keys and save it as keys.py.

3. Change absolute path in PingPong.py

Modify complete_path_to_IDs from '/home/edmz/TwitterBot/PingPong/IDs' '/your/absolute/path/to/PingPong/IDs'

You need to be careful about paths. Note that I had a hard time fixing it and I'm not sure I get it right... However, before changing relative path to absolute path, running script worked fine, but not in a CRON job. It may come from the CWD not being the same. More information on this CWD problem might be found in this question on Stack Overflow (note that I did NOT have to make a .sh script or chmod anything to sort this out).

4. Set up a CRON job

# open your crontab editor
crontab -e # then copy-paste "*/15 * * * * python3 path/to/PingPong/PingPong.py" and exit editor pressing Ctrl + S Ctrl + X

# see what's in your crontab
crontab -l

# check on your past cron jobs 
grep CRON /var/log/syslog

pingpong's People

Contributors

edoumazane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.