Git Product home page Git Product logo

instagram-dm-webhook-service's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @matej2
  • ๐Ÿ‘€ Iโ€™m interested in backend, web design and Raspberry PI
  • ๐ŸŒฑ Iโ€™m currently learning AI and Salesforce
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on Salesforce, Reddit bots or any software that runs on Raspberry pi

instagram-dm-webhook-service's People

Contributors

matej2 avatar nimaamiri92 avatar noon2dusk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

webmaia shiasy

instagram-dm-webhook-service's Issues

Move conf to env vars

Describe the solution you'd like
Instead of json we will have configuration defined in environment variables. Additional libaries may need to be added as dependencies

Describe alternatives you've considered
/

Additional context
/

Remove logging and refactor code

Is your feature request related to a problem? Please describe.
/

Describe the solution you'd like
Replace logging with monolog or another libary. Code refactoring; maybe move mock data in another file or extend existing class and then inject data, remove all references of "bot" in code/file namings

Describe alternatives you've considered
/

Additional context
/

Increasing wait time

Instead of whitelist, we could create exponential wait time calculator.

For example, we have limit capacity of 200 webhook calls per hour . Initial call has wait time of 3 seconds and for each next call we increase wait time untill the program reaches minimum safe wait time of 20 seconds (the time pause which makes sure that hourly quota is not exceeded).

This could be calculated based on the number of already processed messages from last iteration (from last hour)

See the following example:

  • x axis - in percent: webhook quotas
  • y asix - wait time

image

y=0.169x+3 { x<100 }
y=20 {x >100}

EDIT: Instead of this i implemented wait time between calls

Call to chatbot.com

Is your feature request related to a problem? Please describe.

Currently application requires a lot of informations for configurations. There are only a few services which support talking to chatbot using api, so it would be enought to change application so it would call the API.

Describe the solution you'd like

Application should call chatbot.com (or any other alternative) and receive chat response. Keep application with webhook functionality in a separate branch

Describe alternatives you've considered
/

Additional context
/

Implement 'isUnseenCount' checks

Is your feature request related to a problem? Please describe.
Currently the application iterates over all threads in direct message inbox. This could be a big performance problem if we have a lot of messages.

Describe the solution you'd like
We need to implement unseen message count checks. Therefore, application wont even run if there are no unseen messages. Also, after executing, application must mark processed unread messages as read.

Describe alternatives you've considered
/

Additional context
/

Docker file

We need docker file similar to this file, with few changes: base image will be php withouth apache and we need to setup crontabs, which will run main.php:

dm-webhook cron file contents:

* 0/15 * ? * * * php -f /path-to-dm-bot/main.php

Test environment

It would be good to have test environment on heroku. For testing, it is enough to setup hourly run scedules in cron tab.

Application should be withouth a web server as described here

Also if we can, we should setup GitHub actions auto deploy on Heroku

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.