Difference between revisions of "Tweet-toot"

From Fixme.ch
Jump to: navigation, search
Line 10: Line 10:
 
=== clonage du projet ===
 
=== clonage du projet ===
  
git clone https://github.com/ayush-sharma/tweet-toot.git
+
git clone https://github.com/ayush-sharma/tweet-toot.git
  
 
Creation répertoire log
 
Creation répertoire log
  
cd tweet-toot
+
cd tweet-toot
mkdir log
+
mkdir log
  
 
=== creation de virtualenv ===
 
=== creation de virtualenv ===
Line 41: Line 41:
  
 
  {
 
  {
"gen.APP_NAME": "Tweet-Toot",
+
"gen.APP_NAME": "Tweet-Toot",
 
+
"gen.log_timestamp": "%Y-%m-%d %H:%M:%S",
"gen.log_timestamp": "%Y-%m-%d %H:%M:%S",
+
"tweets.source_account_url": "https://twitter.com/_fixme",
 
+
"toots.host_instance": "https://tooting.ch",
"tweets.source_account_url": "https://twitter.com/_fixme",
+
"toots.app_secure_token": "cK2YcOkkAB7UGUPjd3JX4VJSX6EfvNdT2TIm1k0AOIc",
 
+
"toots.cache_path": "/tmp/"
"toots.host_instance": "https://tooting.ch",
+
 
+
"toots.app_secure_token": "cK2YcOkkAB7UGUPjd3JX4VJSX6EfvNdT2TIm1k0AOIc",
+
 
+
"toots.cache_path": "/tmp/"
+
 
+
 
  }
 
  }
  
Line 59: Line 53:
 
== Exécution ==
 
== Exécution ==
  
=== Manuellement ===
+
=== Manuel ===
  
on se place dans le répertoireapplicatif
+
on se place dans le répertoire applicatif
  
 
----
 
----
Line 69: Line 63:
 
  python run.py
 
  python run.py
  
 +
=== appel script ===
  
 
==== script bash ====
 
==== script bash ====
Line 84: Line 79:
 
----
 
----
  
Exécution
+
==== Exécution ====
  
 
  ./tweet-toot.bash
 
  ./tweet-toot.bash
Line 93: Line 88:
  
 
appel depuis appli trigger...
 
appel depuis appli trigger...
 +
Creation d'un log par toot

Revision as of 19:52, 20 December 2019

Application creation de toot

Script Python3 dont le code est sur github .

tweet-toot

Installation

clonage du projet

git clone https://github.com/ayush-sharma/tweet-toot.git

Creation répertoire log

cd tweet-toot
mkdir log

creation de virtualenv

Pre-requis :

python3 , virtuelen

apt-get install python3-venv

cd tweet-toot
python3 -m venv venv

after activate venv

installation requirement

 pip install -r requirements.txt


configuration in file config.json

{
"gen.APP_NAME": "Tweet-Toot",
"gen.log_timestamp": "%Y-%m-%d %H:%M:%S",
"tweets.source_account_url": "https://twitter.com/_fixme",
"toots.host_instance": "https://tooting.ch",
"toots.app_secure_token": "cK2YcOkkAB7UGUPjd3JX4VJSX6EfvNdT2TIm1k0AOIc",
"toots.cache_path": "/tmp/"
}

toots.app_secure_token : authorize application to write on mastodon. connexion sur le serveurMastodon ,Creation application ....

Exécution

Manuel

on se place dans le répertoire applicatif


cd tweet-toot
source  venv/bin/activate
python run.py

appel script

script bash

code

 #! /usr/bin/bash
 export VENV=$PROJET/src/tweet-toot/venv
 . $VENV/bin/activate
 python run.py >>log/lastweet.log



Exécution

./tweet-toot.bash


TO-DO

appel depuis appli trigger... Creation d'un log par toot