Code Monkey home page Code Monkey logo

imgurplus's Introduction

Imgur Plus Bot

Library Python Pillow-lib Request-lib License

Summary

  • Easy to setup, no compilation needed.
  • Has many funtions that normal bots are not able to do, e.g., resize images.
  • Simple and intuitive usage.
  • Compatible with most of recent added telegram additions.
  • Really fast and stable.

Installation

Debian/Ubuntu and derivatives:

# Tested on Ubuntu 14.04 stable.
sudo apt-get install python3
sudo apt-get install -y python3-pip
sudo pip3 install python-telegram-bot --upgrade
sudo pip3 install requests
sudo pip3 install Pillow
pip install imageio
pip install PyMySQL

# If you have errors installing Pillow 
sudo apt-get install python3-dev
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk

# You will need install this first than imageio
sudo apt-get install python3-dev python3-setuptools
sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev

Windows :

# Tested on Windows 10.
Download and install the newest version of python 3.X.X -> https://www.python.org/downloads/
pip install python-telegram-bot --upgrade
pip install requests
pip install Pillow
pip install imageio
pip install PyMySQL

Configure the bot:

# Edit config file config/botconfig.py.
# the token of the bot you get from t.me/botfather (type: str)
bot_token = "yourtoken"
# db info (Host, User, Password, Databse name) (type: str)
# not implemented yet
db_host = "your db host"
db_user = "your db user"
db_pass = "your db password" #encrypted password (not implemented)
db_name = "your db name"
# a python list containing the telegram ids of the admins of the bot (type: ids are long?)
admins = [133337, 133338]
# imgur api info (api_key, client_id)
api_imgur = "your api id"
clientid_imgur = "your client id"

After installing the dependencies and editing the config, lets start the bot:

 #In Ubuntu
 git clone [email protected]:DcSoK/ImgurPlus.git
 cd imgurplus
 chmod +x bot.py
 python3 bot.py
 #In Windows
 git clone [email protected]:DcSoK/ImgurPlus.git
 cd imgurplus
 python bot.py

Configure database:

 #In Ubuntu or Windows using commands
CREATE DATABASE dbname;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'%' WITH GRANT OPTION;
mysql -u username -p dbname < db\imgurplus.sql

imgurplus's People

Contributors

soksx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.