Code Monkey home page Code Monkey logo

meneamebot's Introduction

meneamebot

This is the code behind telegram bot meneamebot. Reads from "meneame" digg-like news aggregator's rss and forwards stories to bot subscribers. It also updates already-forwarded stories with new values for number of comments, number of clicks, etc.

It was just a proof of concept of what can be done with telegram bots, and a way of learning about python. Any improvement, correction, suggestion or linting is welcome.

To use it, you just need to add subscribers via python command (I'll may create a bot interface for that, too):

$ ./python
Python 3.5.2 (default, Jul  5 2016, 12:43:10) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shelve
>>> data = shelve.open("meneamebot_data", writeback=True)
>>> data['subscribed_users'] = ['first-telegram-id', 'second-telegram-id', ...]
>>> data['sent_messages']={}
>>> data.close()

Also get a token from botfather, and use it as an argumen to the script.

Then you can run it periodically. I use a cron:

$ crontab -e
*/15 * * * * cd /home/meneamebot/bin/ && ./python meneamebot.py MY-BOT-TOKEN

meneamebot's People

Contributors

ersiko 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.