diff --git a/robot.sh b/robot.sh index e0c42ad..4f1b864 100755 --- a/robot.sh +++ b/robot.sh @@ -8,8 +8,10 @@ export TMP_PATH=$APPS_PATH/../tmp export DATA_PATH=$APPS_PATH/../data export FLAG_PATH=$APPS_PATH/../flags +export TS=`date +%s` export MINUTE=`date +%M | sed 's/^0*//'` export DATE=`date +%Y%m%d0000` +export DATEHOUR=`date +%Y%m%d%H` # # Synchronize the Blockchain diff --git a/scripts/tweet.sh b/scripts/tweet.sh index 982bf42..f9829c2 100755 --- a/scripts/tweet.sh +++ b/scripts/tweet.sh @@ -70,8 +70,11 @@ fi # tweet Topisto : empty blocks $APPS_PATH/twitter/emptybot/robot.sh 2>&1 -TWEET=8 -if [ $((MINUTE % $TWEET)) -eq 0 ] +# tweet frequency : 2 Hours +#TWEETFREQ=7200 +#if [ $((TS % $TWEETFREQ)) -eq 0 ] +# Tweet freq : One per Hour +if [ ! -f $DATA_PATH/twitterbot/$DATEHOUR ] then debug "send a TWEET" @@ -80,6 +83,8 @@ then # "auto likes" from Topisto $APPS_PATH/twitter/likebot/robot.sh 2>&1 + + touch $DATA_PATH/twitterbot/$DATEHOUR else debug "skip TWEET" fi diff --git a/twitter/twitterbot/robot.sh b/twitter/twitterbot/robot.sh index a7c7081..b8a16d9 100755 --- a/twitter/twitterbot/robot.sh +++ b/twitter/twitterbot/robot.sh @@ -14,19 +14,17 @@ cd $APPS_PATH/twitter/twitterbot # # Tweet pour un assemblage de hash # -for fichier in `ls $DATA_PATH/hashes2hashes/*.png` +for fichier in `ls -tr $DATA_PATH/hashes2hashes/*.png` do - BLOCK=`basename $fichier .png` - if [ ! -f $DATA_PATH/twitterbot/assemblage_$BLOCK ] - then - php robot.php $BLOCK CONFIRMED hashes2hashes - touch $DATA_PATH/twitterbot/assemblage_$BLOCK - #rm -f $flag - #exit 0 - sleep 30 - fi + BLOCK_HASH=`basename $fichier .png` done +if [ 5 -gt $((RANDOM % 100)) ] +then + php robot.php $BLOCK_HASH CONFIRMED hashes2hashes + touch $DATA_PATH/twitterbot/$BLOCK_HASH +fi + # # Se lancer pour un tweet sur un block unique #