Coder Social home page Coder Social logo

hasibulkabir / telegramircimageproxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codetalkio/telegramircimageproxy

0.0 1.0 1.0 83 KB

Telegram bot that accepts photos (and images), uploads them to imgur and posts them to an IRC channel

License: MIT License

Python 100.00%

telegramircimageproxy's Introduction

TelegramIRCImageProxy

A Telegram bot that accepts photos (and images), uploads them to http://imgur.com and posts the URL to an IRC channel. Intended for quickly sharing images from mobile phones.

Installation

pip install -r requirements.txt

Configuration

Configuration is saved in config.yaml. All available keys are pre-inserted, with some comments. In order to override these settings with your own, you should create a new file named user_config.yaml and follow the same structure.

The following keys are required:

  • telegram.token

    Create a Telegram bot using the @BotFather bot (https://telegram.me/BotFather)

  • imgur.client_id and imgur.client_secret

    Register an application at https://api.imgur.com/oauth2/addclient.

  • imgur.refresh_token

    Add the two client_ keys and run python authenticate_imgur.py to obtain an access_token and a refresh_token, then insert the refresh_token into the config file.

    This is required to upload images to a user account, and currently the only option.

  • irc.host and irc.channel

    Where to post URLs to the images.

Usage

Just run

python __main__.py

.

Features

  • Uses long polling to fetch updates from the Telegram Bot API, yielding nearly instant updates.
  • Optionally groups all uploaded images into an album.
  • All images are cached in a database. This allows to reschedule failed image uploads on the next restart without re-downloading the file, for example, and more.
  • Users on Telegram have to authenticate in the IRC channel in order to be able to proxy images through the bot. The bot will then associate the images it posts with the authenticating user's IRC nick name (or any other configurable name), but it won't use names from Telegram.
  • Creates log files for debugging and whatnot.

telegramircimageproxy's People

Contributors

fichtefoll avatar

Watchers

James Cloos avatar

Forkers

notfounderror

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.