Code Monkey home page Code Monkey logo

tournesol-twitter-bot's Introduction

⚠️ The Tournesol Twitter Bot is now integrated into the backend of the main repository of Tournesol ⚠️

Tournesol Twitter Bot

TournesolBot is based on the platform Tournesol.app.

The repository gathers scripts to execute the main functions of the TournesolBot in different languages

The main purpose of the TournesolBot is to:

  • Tweet daily a video recommendation from the top ranked video on Tournesol
  • Respond to tweet in which it is mentions and ask about the quality of a video

Installation

Clone this directory somewhere on your computer.

Go into the directory and run the following command:

pip install -e .

Usage

cd tournesolbot

python tournesolbot.py [-h] [-l 'en'/'fr'] [-a] [-d] [-m] [-r] [-t 'My tweet']

This is this help of the Tournesol-Twitter-Bot.

Requested arguments:

-l	select the language that will be use to tweet and for the other functions.

Optional arguments:

-h	show this help message and exit
-a	authentication to the Twitter account (access required!)
-d	make the daily recommandation tweet
-m	get the missing twitter account to fill the 'YT_2_TWITTER' dictionnary.
-r	respond to tweets in which Tournesol-Bot has been mentioned.
-t	tweet the corresponding string (e.g. 'My tweet').

Examples


NOTE!

If you don't own the TournesolBot twitter account, you can use the following command but without the argument "-a" (authentification) and "-r" (respond to mentions)


Write the daily tweet with the french twitter account:

python tournesolbot.py -l fr -a -d

Respond to mention with the english twitter account:

python tournesolbot.py -l en -a -r

Creating a list of missing YouTube channel not associated yet with a twitter account:

python tournesolbot.py -l en -m

tournesol-twitter-bot's People

Contributors

aidanjungo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

4383

tournesol-twitter-bot's Issues

Use offset instead of limit

response = requests.get(f"https://tournesol.app/api/v2/videos/search_tournesol/?backfire_risk=100&better_habits=100&diversity_inclusion=100&engaging=100&entertaining_relaxing=100&importance=100&layman_friendly=100&pedagogy=100&reliability=100&days_ago_lte={days_ago}&language={language}&limit={from_top}").json()

To load the second page of results, you can use the offset query parameter.

The results are always [offset, offset+limit]

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.