Giter Site home page Giter Site logo

report_collab_bot's Introduction

Report collab bot

published

Report collab bot - the app that uses Webex Bot to collect and process answers from users.

  • collect and count the user's activities with a bot. For example daily task report etc
  • sent motivated sentence as a response on user answer
  • aggregate and submit daily reports to the appropriate user (or user list)
  • make you happy
  • work with image recognition (you can choose your own module, links, and information here)

For which purpose you can use it:

  • for daily monitoring users activities (sports activities, employee daily task)
  • motivate users to make some task using technologies

Requirements

Installation

1. Clone and open project

git clone https://github.com/oborys/report_collab_bot
cd report_collab_bot

2. Open files app/views.py and Dockerfile

3. Create a Webex bot and Webhook

Create Webex Bot:

Copy Bot's Access Token

Paste it into the file app/views.py variable bearer

For sent information to your server/localhost, create Webhook

For testing on localhost, you can use ngrok After installing ngrok open new terminal window and run the command

ngrok http 56733

Do not close this terminal window, since the app needs it to redirect webhooks to your localhost.

Сopy and paste url in file app/views.py variable webhookUrl

4. Next, you need to edit this variable reportPeopleEmailList

You can insert their email addresses of Webex users who will receive a daily report with an aggregated statistic from the bot. Add at least one email address.

5. Set daily report time

reportTime = '20:00'

If you run the app at 15:14 bot report will be sent at 20:14

6. Set your time zone in Dockerfile

By default, timezone is Europe/Kyiv

After completing all the above points, we can build a container

Run docker container on port 56733

bash start.sh

Check app availability on your server http://ip-address:56733 or http://localhost:56733

For checking docker container you can use next CLI command

docker ps

Running the next command you can see information about container logs, also monitor all output information from the Python app. And command like print, logging.debug, logging.info, logging.warning.

docker logs [CONTAINER ID]

If you edit code files or requirements.txt, run next commands to apply changes

sudo docker stop sport_report_collab.docker && sudo docker start sport_report_collab.docker

Remove the docker container. In case if you got some critical errors, or edit your Dockerfile or uwsgi.ini

docker rm -f [CONTAINER ID]

Interaction with bot

Find a bot to interact with

Enter the email of bot that you create

Interaction with bot

Sample of daily report

How it's works

Users, in the time interval (24h), can send message to the bot: +/- or done/unfinished or yep/nope by default: +/-

Get motivated response sentence like "You do great!", "Bad Training Is Devastating". by default: bot response is adapted for sport exercise and stored in files:

sentence_done.txt

sentence_unfinished.txt

You can edit this file and add in there your custom responses.

Each response should be in a new line. The code detects the Unix system's newlines (\n) symbol as a line delineator.

The main part of the code is stored in app/views.py

At the end of source code, you can find a scheduler

sched = BackgroundScheduler(daemon=True)
sched.add_job(sendStatistic, 'interval', minutes=60)
sched.start()

When you want to quickly test and debug your changes you can change variable minutes from 60 to 1 minute

Image recognition

Users can interact with bot by sending a photo, using a smartphone/laptop camera. For this scenario, you can add Image recognition and count it as a user response. In sport case: you can add your custom module that can detect whether the user is dressed in a sports uniform or not. This feature needs to be tested on your production environment

Which libraries and project I suggest to use:

Other Useful links

report_collab_bot's People

Contributors

oborys avatar dependabot[bot] avatar

Watchers

James Cloos avatar  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.