160 MB of code to open an infinite network of friends

This commit is contained in:
fred 2023-04-26 21:20:36 +02:00
parent 34f72ea274
commit dab40e065a
13 changed files with 1008 additions and 185 deletions

View File

@ -220,6 +220,8 @@ case ${CAT} in
########################################################################
vlog)
mkdir -p ~/Astroport/${PLAYER}/vlog
espeak "Ready to record your webcam"
[ ! $2 ] && zenity --warning --width 300 --text "${PLAYER}. Prêt à enregistrer votre video ?"
@ -242,6 +244,8 @@ case ${CAT} in
########################################################################
youtube)
mkdir -p ~/Astroport/${PLAYER}/youtube
espeak "youtube : video copying"
YTURL="$URL"
@ -294,17 +298,17 @@ espeak "OK $TITLE copied"
MEDIAID="$REVSOURCE${YID}"
MEDIAKEY="YOUTUBE_${MEDIAID}"
FILE_PATH="$HOME/Astroport/youtube/$MEDIAID"
FILE_PATH="$HOME/Astroport/${PLAYER}/youtube/$MEDIAID"
mkdir -p ${FILE_PATH} && mv -f ${YTEMP}/* ${FILE_PATH}/
FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2)
RES=${FILE_RES%?}0p
## CREATE "~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt" and video.json
## CREATE "~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt" and video.json
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
## KEEPS KODI COMPATIBILITY (BROKEN astroport.py !! ) : TODO DEBUG
echo "youtube;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt
echo "youtube;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
@ -323,6 +327,8 @@ rm -Rf ${YTEMP}
web)
mkdir -p ~/Astroport/${PLAYER}/web
# URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6"
espeak "Mirror web site"
cd ~/.zen/tmp/
@ -354,7 +360,7 @@ rm -Rf ${YTEMP}
MEDIAID="WEB_${NIAMOD}" # MEDIAID=WEB_io.ipfs.discuss.
FILE_PATH="$HOME/Astroport/web/$MEDIAID"; # FILE_PATH=/home/fred/Astroport/web/WEB_io.ipfs.discuss.
FILE_PATH="$HOME/Astroport/${PLAYER}/web/$MEDIAID"; # FILE_PATH=/home/fred/Astroport/${PLAYER}/web/WEB_io.ipfs.discuss.
start=`date +%s`
@ -385,7 +391,7 @@ rm -Rf ${YTEMP}
ipfs name publish -k $MEDIAKEY /ipfs/$IPFSREPFILEID # PUBLISH $MEDIAKEY
## CREATE ajouter_video.txt
echo "web;${MEDIAID};${MOATS};${TITLE};${SAISON};${GENRES};$IPNSKEY;${RES};/ipfs/$IPFSREPFILEID" > ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt
echo "web;${MEDIAID};${MOATS};${TITLE};${SAISON};${GENRES};$IPNSKEY;${RES};/ipfs/$IPFSREPFILEID" > ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt
## DURATION LOG
end=`date +%s`
@ -420,7 +426,7 @@ echo '[
"tags": "'ipfs G1Web $PLAYER webmaster@$DOMAIN'"
}
]
' > ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json
' > ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json
# zenity --warning --width ${large} --text "Copie $URL dans ${FILE_PATH}/ et /ipns/$IPNSKEY"
@ -440,6 +446,8 @@ echo '[
pdf)
mkdir -p ~/Astroport/${PLAYER}/pdf
espeak "Importing file or web page to P D F"
## EVOLVE TO ARTICLE
# httrack --mirror --ext-depth=0 --depth=1 --near --stay-on-same-address --keep-links=0 --path article-x --quiet https://example.com/article-x/
@ -488,10 +496,10 @@ echo '[
MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)"
MEDIAKEY="PDF_${MEDIAID}"
FILE_PATH="$HOME/Astroport/pdf/$MEDIAID"
FILE_PATH="$HOME/Astroport/${PLAYER}/pdf/$MEDIAID"
mkdir -p ${FILE_PATH} && mv ~/.zen/tmp/output.pdf ${FILE_PATH}/${FILE_NAME}
echo "pdf;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt
echo "pdf;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt
espeak 'Document ready'
@ -508,9 +516,11 @@ echo '[
########################################################################
mp3)
mkdir -p ~/Astroport/${PLAYER}/mp3
[[ $URL == "" ]] && URL=$(zenity --entry --width 500 --title "Lien Youtube à convertir en MP3" --text "Indiquez le lien (URL)" --entry-text="")
espeak "OK."
yt-dlp -x --no-mtime --audio-format mp3 --embed-thumbnail --add-metadata -o "$HOME/Astroport/mp3/%(autonumber)s_%(title)s.%(ext)s" "$URL"
yt-dlp -x --no-mtime --audio-format mp3 --embed-thumbnail --add-metadata -o "$HOME/Astroport/${PLAYER}/mp3/%(autonumber)s_%(title)s.%(ext)s" "$URL"
espeak "Ready. check your home Astoport mp3 directory"
break
@ -527,6 +537,9 @@ echo '[
########################################################################
film | serie)
mkdir -p ~/Astroport/${PLAYER}/film
mkdir -p ~/Astroport/${PLAYER}/serie
espeak "please select your file"
# SELECT FILE TO ADD TO ASTROPORT/KODI
@ -552,15 +565,15 @@ TMTL=$(echo $MEDIAID | cut -d '-' -f 2-) # contient la fin du nom de fichier tmd
if ! [[ "$CMED" =~ ^[0-9]+$ ]]
then
zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer... Seules les vidéos référencées sur The Movie Database sont acceptées." && exit 1
zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer... Seules les vidéos référencées sur The Movie Database sont acceptées. Sinon importez en mode 'Video'" && exit 1
fi
MEDIAID=$CMED
MEDIAKEY="TMDB_$MEDIAID"
# VIDEO TITLE
### CHECK IF PREVIOUS ajouter_video (usefull for Serie)
[[ -f ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt ]] \
&& PRE=$(cat ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt | cut -d ';' -f 4) \
[[ -f ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt ]] \
&& PRE=$(cat ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt | cut -d ';' -f 4) \
|| PRE=${FILE_TITLE}
###
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${PRE}")
@ -569,8 +582,8 @@ TITLE=$(echo "${TITLE}" | detox --inline ) # Clean TITLE (NO ;)
# VIDEO YEAR
### CHECK IF PREVIOUS ajouter_video (Serie case)
[[ -f ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt ]] \
&& PRE=$(cat ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt | cut -d ';' -f 3) \
[[ -f ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt ]] \
&& PRE=$(cat ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt | cut -d ';' -f 3) \
|| PRE=""
YEAR=$(zenity --entry --width 300 --title "Année" --text "Indiquez année de la vidéo. Exemple: 1985" --entry-text="${PRE}")
@ -580,8 +593,8 @@ RES=${FILE_RES%?}0p # Rounding. Replace last digit with 0
# VIDEO SEASON or SAGA
### CHECK IF PREVIOUS ajouter_video (Serie case)
[[ -f ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt ]] \
&& PRE=$(cat ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt | cut -d ';' -f 5 | cut -d '_' -f 2)
[[ -f ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt ]] \
&& PRE=$(cat ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt | cut -d ';' -f 5 | cut -d '_' -f 2)
[[ "${CAT}" == "serie" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="${PRE}")
[[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="")
[[ $SAISON ]] && SAISON="_$SAISON"
@ -643,18 +656,18 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
&& FILE_EXT="mp4" && FILE_NAME="$FILE_TITLE.mp4" \
&& espeak "M P 4 ready"
mkdir -p ~/Astroport/${CAT}/${MEDIAID}/
mkdir -p ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/
[[ ! -s "$HOME/Astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" ]] \
&& cp "${FILE_PATH}/${FILE_NAME}" "$HOME/Astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" \
[[ ! -s "$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" ]] \
&& cp "${FILE_PATH}/${FILE_NAME}" "$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" \
&& [ $? != 0 ] \
&& zenity --warning --width ${large} --text "(☓‿‿☓) ${FILE_PATH}/${FILE_NAME} vers ~/Astroport - EXIT -" && exit 1
FILE_NAME="${TITLE}${SAISON}.${FILE_EXT}"
## CREATE "~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt"
## CREATE "~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt"
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt
echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
#######################################################
######## NOT CREATING TIDDLER JSON... SWALLOW IS POST-PROCESSED
@ -672,6 +685,8 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i
video)
mkdir -p ~/Astroport/${PLAYER}/video
espeak "Add your personnal video in TW"
#~ zenity --warning --width 600 --text 'DEV-DEBUG : REGISTER https://git.p2p.legal'
@ -700,15 +715,15 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i
## video_timestamp INDEX
MEDIAID="$(date -u +%s%N | cut -b1-13)"
mkdir -p ~/Astroport/${CAT}/${MEDIAID}/
mkdir -p ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/
MEDIAKEY="VIDEO_${MEDIAID}"
## CREATE SIMPLE JSON (EXPERIENCE WITH it)
jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"tag":$htag}' > ~/Astroport/${CAT}/${MEDIAID}/video.json
jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"tag":$htag}' > ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/video.json
## MOVE FILE FOR new_file_in_astroport POST TREATMENT
[[ ! -s "$HOME/Astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" ]] \
&& cp "${FILE_PATH}/${FILE_NAME}" "$HOME/Astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}"
[[ ! -s "$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}" ]] \
&& cp "${FILE_PATH}/${FILE_NAME}" "$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}"
FILE_NAME="${TITLE}.${FILE_EXT}"
@ -750,50 +765,50 @@ fi
###################################
### MOVING FILE TO ~/astroport ####
###################################
mkdir -p ~/Astroport/${CAT}/${MEDIAID}/
mv ~/.zen/tmp/screen.png ~/Astroport/${CAT}/${MEDIAID}/screen.png
mkdir -p ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/
mv ~/.zen/tmp/screen.png ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/screen.png
########################################################################
# ADD $FILE to IPFS / ASTROPORT / KODI
echo "(♥‿‿♥) new_file_in_astroport.sh \"$HOME/Astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" "$3"
[[ -f ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt ]] && cat ~/Astroport/${CAT}/${MEDIAID}/ajouter_video.txt
# LOG NOISE # [[ -f ~/Astroport/${CAT}/${MEDIAID}/video.json ]] && cat ~/Astroport/${CAT}/${MEDIAID}/video.json
echo "(♥‿‿♥) new_file_in_astroport.sh \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" "$3"
[[ -f ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt ]] && cat ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/ajouter_video.txt
# LOG NOISE # [[ -f ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/video.json ]] && cat ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/video.json
########################################################################
## CREATION DU FICHIER ~/Astroport/Add_${MEDIAKEY}_script.sh
## CREATION DU FICHIER ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
########################################################################
### AJOUT DANS IPFS #######################################################
########################################################################
####################################new_file_in_astroport.sh##################
########################################################################
if [[ ! -s ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
if [[ ! -s ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
[[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB"
timestamp=$(date -u +%s%N | cut -b1-13)
## CREATE BASH SCRIPT
echo "MEDIAKEY=${MEDIAKEY}" > ~/Astroport/Add_${MEDIAKEY}_script.sh
echo "MEDIAKEY=${MEDIAKEY}" > ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
## ACTIVATE h265 conversion .?
#[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\"
#reponse=\$1
#[[ ! \$reponse ]] && read reponse
#if [[ ! \$reponse ]]; then
# ffmpeg -i \"$HOME/Astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/Astroport/${MEDIAID}.mp4
# mv \"$HOME/Astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/Astroport/${CAT}/${MEDIAID}/${FILE_NAME}.old\"
# mv $HOME/Astroport/${MEDIAID}.mp4 \"$HOME/Astroport/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\"
# ${MY_PATH}/tools/new_file_in_astroport.sh \"$HOME/Astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\"
#else" >> ~/Astroport/Add_${MEDIAKEY}_script.sh
# ffmpeg -i \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/Astroport/${PLAYER}/${MEDIAID}.mp4
# mv \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${FILE_NAME}.old\"
# mv $HOME/Astroport/${PLAYER}/${MEDIAID}.mp4 \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\"
# ${MY_PATH}/tools/new_file_in_astroport.sh \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\"
#else" >> ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
# $3 is the G1PUB of the PLAYER
echo "${MY_PATH}/tools/new_file_in_astroport.sh \"$HOME/Astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" \"$G1PUB\"" >> ~/Astroport/Add_${MEDIAKEY}_script.sh
echo "${MY_PATH}/tools/new_file_in_astroport.sh \"$HOME/Astroport/${PLAYER}/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" \"$G1PUB\"" >> ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
#[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/Astroport/Add_${MEDIAKEY}_script.sh
#[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
echo "mv ~/Astroport/Add_${MEDIAKEY}_script.sh \"$HOME/Astroport/${FILE_NAME}_DONE.sh\"
" >> ~/Astroport/Add_${MEDIAKEY}_script.sh
echo "mv ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh \"$HOME/Astroport/${PLAYER}/${FILE_NAME}_DONE.sh\"
" >> ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
chmod +x ~/Astroport/Add_${MEDIAKEY}_script.sh
chmod +x ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh
########################################################################
echo "(♥‿‿♥) $MEDIAKEY IPFS MIAM (ᵔ◡◡ᵔ)"
@ -802,7 +817,7 @@ if [[ ! -s ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
espeak "Adding $CAT to I P F S. Please Wait"
## RUN BASH SCRIPT
bash ~/Astroport/Add_${MEDIAKEY}_script.sh "noh265"
bash ~/Astroport/${PLAYER}/Add_${MEDIAKEY}_script.sh "noh265"
## OR PUT IN YOUR QUEUE
## CREATING TIMELINE FOR BATCH TREATMENT
@ -817,7 +832,7 @@ fi
#######################################
########################## TIDDLER JSON READY
#######################################
if [[ -s ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
if [[ -s ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
espeak "Updating T W"
########################################################################
@ -842,7 +857,7 @@ if [[ -s ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
echo "Nouveau MEDIAKEY dans TW $PSEUDO / ${PLAYER} : $myIPFS/ipns/$ASTRONAUTENS"
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
--import ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json "application/json" \
--import ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json "application/json" \
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
if [[ -s ~/.zen/tmp/newindex.html ]]; then
@ -862,7 +877,7 @@ if [[ -s ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ]]; then
&& sed -i "s~$CURCHAIN~$ZCHAIN~g" ~/.zen/tmp/newindex.html
################################################
mv ~/Astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ~/Astroport/${CAT}/${MEDIAID}/${MOATS}.dragdrop.json
mv ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json ~/Astroport/${PLAYER}/${CAT}/${MEDIAID}/${MOATS}.dragdrop.json
espeak "I P N S Publishing. Please wait..."
cp ~/.zen/tmp/newindex.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
[[ $DIFF ]] && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \

7
rec.desktop Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=REC
Exec=/home/_USER_/.zen/Astroport.ONE/ajouter_media.sh
Icon=/home/_USER_/.zen/Astroport.ONE/rec.png
Type=Application
Categories=Utility

View File

@ -26,13 +26,13 @@ mkdir -p ~/.zen/tmp
########################################################################
# CREATE ~/astroport FILESYSTEM GATE
mkdir -p ~/Astroport/film
mkdir -p ~/Astroport/serie
mkdir -p ~/Astroport/anime
mkdir -p ~/Astroport/page
mkdir -p ~/Astroport/web
mkdir -p ~/Astroport/video
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/Astroport/ajouter_video.modele.txt
mkdir -p ~/Astroport/${PLAYER}/film
mkdir -p ~/Astroport/${PLAYER}/serie
mkdir -p ~/Astroport/${PLAYER}/anime
mkdir -p ~/Astroport/${PLAYER}/page
mkdir -p ~/Astroport/${PLAYER}/web
mkdir -p ~/Astroport/${PLAYER}/video
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/Astroport/${PLAYER}/ajouter_video.modele.txt
#######################################################################

143
tools/FR_AssembleeNationale.sh Executable file
View File

@ -0,0 +1,143 @@
#!/usr/bin/env bash
set -e
function trap_errors() {
echo ""
echo "Debbuging:"
echo " pwd: $(pwd)"
echo " MAIN_DIR: ${MAIN_DIR}"
clean_on_exit
}
trap trap_errors ERR
MAIN_DIR=~/.zen/FR
mkdir -p ~/.zen/FR
USER_AGENT="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
cd "${MAIN_DIR}"
echo -n "Creating directories..."
TMP_DIR=$(mktemp -d)
mkdir -p "${MAIN_DIR}/data/"
mkdir -p "data/gen/an/images/"
echo " done."
if [[ ! -s "${MAIN_DIR}/data/an.zip" ]]; then
echo -n "Downloading data..."
wget -q -U "${USER_AGENT}" "https://data.assemblee-nationale.fr/static/openData/repository/16/amo/deputes_actifs_mandats_actifs_organes/AMO10_deputes_actifs_mandats_actifs_organes.json.zip" -O "${MAIN_DIR}/data/an.zip"
cd "${MAIN_DIR}/data/"
echo " done."
echo -n "Extracting data..."
unzip an.zip
echo " done. "
fi
cd "${MAIN_DIR}/data/"
find json/acteur/ -type f | sed 's/\.json//i' | sed 's/json\/acteur\///i' | while read -r key; do
echo -n "Parsing ${key}"
first_name=$(jq -r .acteur.etatCivil.ident.prenom "json/acteur/${key}.json")
echo -n " (${first_name} "
last_name=$(jq -r .acteur.etatCivil.ident.nom "json/acteur/${key}.json")
echo "${last_name})"
email=$(jq -r '.acteur.adresses.adresse | map(. | select(.type=="15")) | .[].valElec' "json/acteur/${key}.json" | tac | awk '{print tolower($0)}')
phoneRaw=$(jq -r '.acteur.adresses.adresse | map(. | select(.type=="11")) | .[].valElec' "json/acteur/${key}.json" | tac)
IFS=$'\n'
phone=""
if [ ! -z "$phoneRaw" ]; then
for i in $phoneRaw; do
phone="$(echo ${i} | tr -d ' .' | sed 's/(0)//i' | sed 's/^00/\+/i' | sed 's/^0590/\+590/i' | sed 's/^0596/\+596/i' | sed 's/^0594/\+594/i' | sed 's/^0262/\+262/i' | sed 's/^0508/\+508/i' | sed 's/^0269/\+262269/i' )"$'\n'"${phone}"
done
fi
phonesChamber=$(jq -r "map(select(.name==\"${first_name} ${last_name}\")) | .[].phone" "json/acteur/${key}.json" | tr -d ' .' 2>/dev/null)
if [ ! -z "$phonesChamber" ]; then
for i in $phonesChamber; do
phone=$(echo "${phone}" | sed "s/${i}//g" | sort -u)
phone="${i}"$'\n'"${phone}"
done
fi
twitter=$(jq -r '.acteur.adresses.adresse | map(. | select(.type=="24")) | .[].valElec' "json/acteur/${key}.json" | sed 's/\@//i')
facebook=$(jq -r '.acteur.adresses.adresse | map(. | select(.type=="25")) | .[].valElec' "json/acteur/${key}.json" | sed 's/\@//i')
commissionsRef=$(jq -r '.acteur.mandats[] | map(. | select(.typeOrgane=="COMPER" or .typeOrgane=="COMNL")) | .[].organes.organeRef' "json/acteur/${key}.json" | sort -u)
commissions=""
if [ ! -z "$commissionsRef" ]; then
for i in $commissionsRef; do
commissions="${commissions}"$'\n'"$(jq -r .organe.libelleAbrege json/organe/${i}.json)"
done
fi
county=$(jq -r '.acteur.mandats[] | map(. | select(.typeOrgane=="ASSEMBLEE")) | .[].election.lieu.departement' "json/acteur/${key}.json" | head -1)
groupRef=$(jq -r '.acteur.mandats[] | map(. | select(.typeOrgane=="GP")) | .[].organes.organeRef' "json/acteur/${key}.json" | head -1)
group=$(jq -r .organe.libelle json/organe/${groupRef}.json)
photo=$(echo ${key} | sed 's/PA//i')
filename="${MAIN_DIR}/data/${key}.yml"
[[ -s ${filename} ]] && cat "${filename}" && continue
echo -n " Writing data..."
echo "id: ${key}" > "${filename}"
echo "last_name: ${last_name}" >> "${filename}"
echo "first_name: ${first_name}" >> "${filename}"
echo "group: ${group}" >> "${filename}"
echo "county: ${county}" >> "${filename}"
echo "commissions:" >> "${filename}"
if [ ! -z "${commissions}" ]; then
for i in ${commissions}; do
echo "- \"${i}\"" >> "${filename}"
done
fi
echo -n "phone:" >> "${filename}"
if [ ! -z "${phone}" ]; then
echo "" >> "${filename}"
for i in ${phone}; do
echo "- \"${i}\"" >> "${filename}"
done
else
echo " \"\"" >> "${filename}"
fi
echo "email:" >> "${filename}"
if [ ! -z "${email}" ]; then
for i in ${email}; do
echo "- \"${i}\"" >> "${filename}"
done
fi
echo "twitter: ${twitter}" >> "${filename}"
echo "facebook: ${facebook}" >> "${filename}"
echo "photo: ${photo}" >> "${filename}"
echo " done."
echo -n " Downloading photo..."
if [ ! -f "${MAIN_DIR}/data/gen/an/images/${photo}.jpg" ]; then
wget -q -U "${USER_AGENT}" "https://www2.assemblee-nationale.fr/static/tribun/16/photos/${photo}.jpg" -O "${MAIN_DIR}/data/gen/an/images/${photo}.jpg"
fi
echo " done."
cat "${filename}"
CUR=5
WHAT=${RANDOM:0:1}
echo "sleeping $((CUR+WHAT))"
sleep $((CUR+WHAT))
done

View File

@ -11,8 +11,11 @@ MOATS="$2"
[[ ! ${ASTRONAUTENS} || ! $MOATS ]] && echo "${ME} : ASTRONAUTENS & MOATS needed" && exit 1
start=$(date +%s)
[[ ! ${IPFSNODEID} ]] && IPFSNODEID=$(ipfs --timeout 12s id -f='<id>\n') || ( echo "${ME} : IPFSNODEID MISSING" && exit 1 )
[[ ${IPFSNODEID} == "" ]]; then
IPFSNODEID=$(ipfs --timeout 12s id -f='<id>\n')
else
echo "${ME} : IPFSNODEID MISSING" && exit 1
fi
## GETTING LAST TW via IPFS
echo "${ME} : IPFS : ipfs --timeout 120s cat /ipns/${ASTRONAUTENS}"\
&& ipfs --timeout 360s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/coucou/${MOATS}.astroindex.html
@ -50,7 +53,8 @@ start=$(date +%s)
## IN CACHE
echo "${ME} : CACHING ~/.zen/tmp/${IPFSNODEID}/$PLAYER/"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/$PLAYER/
cp -f ~/.zen/tmp/coucou/${MOATS}.astroindex.html ~/.zen/tmp/${IPFSNODEID}/$PLAYER/index.html
cp -f ~/.zen/tmp/coucou/${MOATS}.astroindex.html ~/.zen/tmp/${IPFSNODEID}/$PLAYER/index.html \
&& rm ~/.zen/tmp/coucou/${MOATS}.astroindex.html
### NO TW !!
else

View File

@ -1,94 +0,0 @@
#!/bin/bash
########################################################################
# Author: papiche
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.${MOATS}/)
########################################################################
# download_from_kodi_log.sh
########################################################################
echo "Extract uqload links from ~/.kodi/temp/kodi.${OLD}log"
# Detects uqload links and ask for copying it to $HOME/astroport
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
SCRIPT="${0##*/}"
isKodiRunning=$(ps auxf --sort=+utime | grep -w 'kodi-x11' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
if [[ ! $isKodiRunning ]]; then
echo "Kodi is not running"
fi
# script usage
usage()
{
# if argument passed to function echo it
[ -z "${1}" ] || echo "! ${1}"
# display help
echo "\
# extract played uqload links from kodi log file
$(basename "$0") : current log scraping
$(basename "$0") old scraping"
exit 2
}
IPFSNODEID=$(ipfs --timeout 5s id -f='<id>\n')
[[ ! $IPFSNODEID ]] && IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ $IPFSNODEID == "" ]] && echo "IPFS APPLICATION. P.LEASE " && exit 1
mkdir -p ~/.zen/tmp/${IPFSNODEID}/uqdl/
## CHOOSE kodi.${OLD}log
[[ $1 == "old" ]] && OLD='old.' || OLD=''
[[ ! $(which kodi) ]] && echo "KODI IS MISSING." && exit 1
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
## LOOP
cycle=1
for uqlink in $(cat ~/.kodi/temp/kodi.${OLD}log | grep uqload | grep 'play :' | rev | cut -d '/' -f 1 | rev);
do
proname=$(cat ~/.kodi/temp/kodi.${OLD}log | grep uqload | grep $uqlink | grep VideoPlayer | cut -d '=' -f 4 | cut -d '&' -f 1)
uqname=$(urldecode $proname | detox --inline)
[[ ! $uqname ]] && echo "$uqlink is BAD" && continue
cycle=$((cycle+1))
echo "########################################################################"
echo "MANUAL : uqload_downloader https://uqload.com/$uqlink \"$HOME/Astroport/film/${MOATS}/$uqname.mp4\""
! cat ~/.zen/tmp/${IPFSNODEID}/uqdl/commands.fifo | grep -w "$uqname.mp4" && \
echo "uqload_downloader https://uqload.com/$uqlink \"$HOME/Astroport/$uqname.mp4\"" >> ~/.zen/tmp/${IPFSNODEID}/uqdl/commands.fifo || \
echo "$uqname.mp4 detected in ~/.zen/tmp/${IPFSNODEID}/uqdl/commands.fifo"
## CHECK & MANAGE COPY
if [[ $(find $HOME/Astroport -name "$uqname.mp4" -type f -print) ]];
then
echo "FILE ALREADY IN $HOME/Astroport/"
continue
else
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p $HOME/Astroport/film/${MOATS}
echo "DETECTED MOVIE : $uqname (https://uqload.com/$uqlink)"
uqload_downloader https://uqload.com/$uqlink "$HOME/Astroport/film/${MOATS}/$uqname.mp4"
echo "COPY ~/Astroport/film/${MOATS}/$uqname.mp4 DONE"
#~ ## RUNNING ON ASTROPORT STATION?
#~ (
#~ [[ $(which ipfs) && $IPFSNODEID ]] \
#~ && espeak "Download $uqname done. Adding file to I P F S" \
#~ && ~/.zen/Astroport.ONE/tools/new_file_in_astroport.sh "$HOME/Astroport/film/${MOATS}/" "$uqname.mp4"
#~ && CID=$(ipfs add -q ~/Astroport/$uqname.mp4 | tail -n 1) \
#~ && mkdir -p ~/.zen/tmp/$IPFSNODEID/$PLAYER/Astroport/ \
#~ && echo "/ipfs/$CID" > ~/.zen/tmp/$IPFSNODEID/Astroport/$uqname.mp4.ipfs \
#~ && espeak "Added to Station 12345 mapping"
#~ ) &
fi
done
echo
echo "########################################################################"
[[ $cycle == 1 && ! ${OLD} ]] && echo "NOTHING IN CURRENT LOG, TRY old ?" && read OLD && [[ "$OLD" != "" ]] && $MY_PATH/$SCRIPT old
echo "DONE... VideoClub Datacenter Virtuel entre amis."
echo "ASTROPORT. Le web des gens."
exit 0

View File

@ -6,8 +6,8 @@
########################################################################
### TAKE A G1Video tiddlers JSON Flux and make a m3u playlist
###############################################
# USE : $IPFSGW/ipns/$VOEUNS/$PLAYER.tiddlers.json > ~/Astroport/playlist.m3u
## && vlc ~/Astroport/playlist.m3u
# USE : $IPFSGW/ipns/$VOEUNS/$PLAYER.tiddlers.json > ~/Astroport/${PLAYER}/playlist.m3u
## && vlc ~/Astroport/${PLAYER}/playlist.m3u
###############################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
@ -29,7 +29,7 @@ IPFSGW="$2"
[[ ! $VIDEOJSONTIDDLERSURL ]] \
&& echo "Please provide WISHKEY URL : G1Video JSON Flux URL. TRY" \
&& echo "$MY_PATH/$ME $IPFSGW/ipns/k51qzi5uqu5dkb5rpiwbu1waex0ve41mi3k3935712z6nhrdesicg2te53glp1/fred@g1sms.fr.tiddlers.json > ~/Astroport/playlist.m3u" \
&& echo "$MY_PATH/$ME $IPFSGW/ipns/k51qzi5uqu5dkb5rpiwbu1waex0ve41mi3k3935712z6nhrdesicg2te53glp1/fred@g1sms.fr.tiddlers.json > ~/Astroport/${PLAYER}/playlist.m3u" \
&& exit 1
JT=$(echo $VIDEOJSONTIDDLERSURL | rev | cut -d '/' -f 1 | rev)

View File

@ -4,7 +4,7 @@
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# COPY ~/Astroport/* files to IPFS
# COPY ~/Astroport/${PLAYER}/* files to IPFS
# Publish INDEX ~/.zen/game/players/$PLAYER/ipfs/.*/${PREFIX}ASTRXBIAN
######## #### ### ## #
start=`date +%s`
@ -22,15 +22,15 @@ YOU=$(myIpfsApi);
alias zenity='zenity 2> >(grep -v GtkDialog >&2)'
# ~/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/Astroport/kodi/vstream/${PREFIX}ASTRXBIAN
# ~/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/Astroport/${PLAYER}/kodi/vstream/${PREFIX}ASTRXBIAN
# Astropot/Kodi/Vstream source reads ${PREFIX}ASTRXBIAN from $myIPFS/.$IPFNODEID/
# Index File Format (could be enhanced) is using Kodi TMDB enhancement
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
########################################################################
## RUN inotifywait process ~/Astroport/ NEW FILE DETECT
## RUN inotifywait process ~/Astroport/${PLAYER}/ NEW FILE DETECT
# /usr/bin/inotifywait -r -e close_write -m /home/$YOU/astroport | while read dir flags file; do ~/.zen/Astroport.ONE/tools/new_file_in_astroport.sh "$dir" "$file"; done &
# mkdir -p ~/Astroport/youtube
# mkdir -p ~/Astroport/mp3
# mkdir -p ~/Astroport/${PLAYER}/youtube
# mkdir -p ~/Astroport/${PLAYER}/mp3
########################################################################
path="$1"
@ -93,11 +93,11 @@ PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null);
## Indicate IPFSNODEID copying
mkdir -p ~/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}
### SOURCE IS ~/Astroport/ !!
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'Astroport') ]] && er="Les fichiers sont à placer dans ~/Astroport/ MERCI" && echo "$er" && exit 1
### SOURCE IS ~/Astroport/${PLAYER}/ !!
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'Astroport') ]] && er="Les fichiers sont à placer dans ~/Astroport/${PLAYER}/ MERCI" && echo "$er" && exit 1
### TyPE & type & T = related to ~/astroport location of the infile (mimetype subdivision)
TyPE=$(echo "$path" | cut -d '/' -f 5 ) # ex: /home/$YOU/Astroport/... TyPE(film, youtube, mp3, video, pdf)/ REFERENCE /
TyPE=$(echo "$path" | cut -d '/' -f 5 ) # ex: /home/$YOU/Astroport/${PLAYER}/... TyPE(film, youtube, mp3, video, pdf)/ REFERENCE /
type=$(echo "$TyPE" | awk '{ print tolower($0) }')
PREFIX=$(echo "$TyPE" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, Y, M ou Y (all the alaphabet can address a data type
@ -243,21 +243,21 @@ then
[[ ! $3 ]] && HASHTAG=$(awk -F '~' '{print $2}' <<<$OUTPUT)
# # # # ${MOATS}_ajouter_video.txt DATA # # # #
if [[ -f ~/Astroport/${TyPE}/${REFERENCE}/ajouter_video.txt ]]
if [[ -f ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/ajouter_video.txt ]]
then
line=$(cat ~/Astroport/${TyPE}/${REFERENCE}/ajouter_video.txt | sed "s/_IPFSREPFILEID_/$IPFSREPFILEID/g" | sed "s/_IPNSKEY_/$IPNS/g" )
line=$(cat ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/ajouter_video.txt | sed "s/_IPFSREPFILEID_/$IPFSREPFILEID/g" | sed "s/_IPNSKEY_/$IPNS/g" )
else
line="$type;${REFERENCE};$YEAR;$TITLE;$SAISON;;${IPNS};$RES;/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME"
fi
echo "-------------------- ${MOATS}_ajouter_video.txt -----------------------------"
echo "$line"
echo "UPDATE ~/Astroport/${TyPE}/${REFERENCE}/ajouter_video.txt"
echo "$line" > ~/Astroport/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt
echo "UPDATE ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/ajouter_video.txt"
echo "$line" > ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt
echo "----------------- GETTING METADATA ----------------------"
CAT=$(echo "$type" | sed -r 's/\<./\U&/g' | sed 's/ //g') # CapitalGluedWords
GENRE=$(cat ~/Astroport/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt | cut -d ';' -f 6 | sed 's/|/ /g' | jq -r '@csv' | sed 's/ /_/g' | sed 's/,/ /g' | sed 's/\"//g' )
YEAR=$(cat ~/Astroport/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt | cut -d ';' -f 3 )
GENRE=$(cat ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt | cut -d ';' -f 6 | sed 's/|/ /g' | jq -r '@csv' | sed 's/ /_/g' | sed 's/,/ /g' | sed 's/\"//g' )
YEAR=$(cat ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt | cut -d ';' -f 3 )
## Adapt TMDB url for season & tag naming
[[ $CAT == "Film" ]] \
@ -266,7 +266,7 @@ then
&& FILETAG="$CapitalGluedTitle"
[[ $CAT == "Serie" ]] && H1="<h1><a target='tmdb' href='https://www.themoviedb.org/tv/"${REFERENCE}"'>"${TITLE}"</a></h1>" \
&& SAISON=$(cat ~/Astroport/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt | cut -d ';' -f 5 | cut -d '_' -f 2) \
&& SAISON=$(cat ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MOATS}_ajouter_video.txt | cut -d ';' -f 5 | cut -d '_' -f 2) \
&& FILETAG=$(echo "$CapitalGluedTitle" | cut -d '_' -f 1)
[[ $CAT == "Youtube" ]] \
@ -276,8 +276,8 @@ then
echo $GENRE $SAISON
## Add screenshot
[[ -f $HOME/Astroport/${TyPE}/${REFERENCE}/screen.png ]] \
&& SCREEN=$(ipfs add -q "$HOME/Astroport/${TyPE}/${REFERENCE}/screen.png" | tail -n 1)
[[ -f $HOME/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/screen.png ]] \
&& SCREEN=$(ipfs add -q "$HOME/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/screen.png" | tail -n 1)
if [[ $(echo "$MIME" | grep 'video') ]]; then
@ -300,8 +300,8 @@ then
fi
## Archive previous dragdrop.json
[[ -s ~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ]] \
&& cp ~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Astroport/${TyPE}/${REFERENCE}/${MOATS}.${MEDIAKEY}.dragdrop.json
[[ -s ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ]] \
&& cp ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MOATS}.${MEDIAKEY}.dragdrop.json
echo "## Creation json tiddler"
echo '[
@ -332,22 +332,22 @@ then
"ipns": "'/ipns/${IPNS}'",
"tmdb": "'${REFERENCE}'",
"modified": "'${MOATS}'",
"tags": "'${TAGS}'" ' > ~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
"tags": "'${TAGS}'" ' > ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
[[ ${CANON} != "" ]] && echo ',
"_canonical_uri": "'${CANON}'"' >> ~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
"_canonical_uri": "'${CANON}'"' >> ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
echo '
}
]
' >> ~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
' >> ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
echo "~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json copy into Station Balise"
echo "~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json copy into Station Balise"
#############################################################################
## ARCHIVE FOR IPFSNODEID CACHE SHARING (APPNAME=KEY)
mkdir -p "$HOME/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/KEY/${MIME}/${MEDIAKEY}/${G1PUB}/"
cp ~/Astroport/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json "$HOME/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/KEY/${MIME}/${MEDIAKEY}/${G1PUB}/tiddler.json"
cp ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json "$HOME/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/KEY/${MIME}/${MEDIAKEY}/${G1PUB}/tiddler.json"
#############################################################################
## TODO : Do we keep that ?

View File

@ -4,7 +4,7 @@
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# COPY ~/Astroport/mp3/artist/song files to IPFS
# COPY ~/Astroport/${PLAYER}/mp3/artist/song files to IPFS
######## #### ### ## #
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
@ -38,7 +38,7 @@ TITLE="${YNAME%.*}"
FILE_EXT="${file##*.}"
[[ "$FILE_EXT" != "mp3" ]] && echo "Extension inconnue. Seul le format mp3 est accepté ... EXIT" && exit 1
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'astroport') ]] && echo "Les fichiers sont à placer dans ~/Astroport/mp3/ MERCI" && exit 1
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'astroport') ]] && echo "Les fichiers sont à placer dans ~/Astroport/${PLAYER}/mp3/ MERCI" && exit 1
CAT=$(echo "$path" | cut -d '/' -f 5 ) # mp3
ARTIST=$(echo "$path" | cut -d '/' -f 6 ) # artist || YID
ALBUM=$(echo "$path" | cut -d '/' -f 7 ) # album || _o-o_ || EMPTY

View File

@ -120,11 +120,11 @@ echo "NEW VIDEO $myIPFS/ipfs/$IPFSROOT"
###########################
MEDIAID=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/Astroport/video/vlog/
mkdir -p ~/Astroport/${PLAYER}/video/vlog/
MEDIAKEY="VLOG_${PLAYER}_${MEDIAID}"
cp ~/.zen/tmp/output.mp4 ~/Astroport/video/vlog/${PLAYER}_$MEDIAID.mp4
cp ~/.zen/tmp/output.mp4 ~/Astroport/${PLAYER}/video/vlog/${PLAYER}_$MEDIAID.mp4
REAL=$(file --mime-type -b "$HOME/Astroport/video/vlog/${PLAYER}_$MEDIAID.mp4")
REAL=$(file --mime-type -b "$HOME/Astroport/${PLAYER}/video/vlog/${PLAYER}_$MEDIAID.mp4")
## TW not displaying direct ipfs video link (only image, pdf, ...) so insert <video> html tag
TEXT="<video controls width=100% poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${IPFSID}"/output.mp4' type='"${REAL}"'></video><h1><a href='/ipfs/"${IPFSROOT}"'>VLOG ("${MEDIAID}") Story</a></h1><br>
@ -152,7 +152,7 @@ echo '[
# LOG
cat ~/.zen/game/players/${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json | jq
cp ~/.zen/game/players/${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json ~/Astroport/video/vlog/
cp ~/.zen/game/players/${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json ~/Astroport/${PLAYER}/video/vlog/
## Adding tiddler to PLAYER TW
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
@ -195,7 +195,7 @@ fi
echo "${PSEUDO} TW VLOG : $myIPFS/ipns/$ASTRONAUTENS/#VLOG_${MEDIAID}"
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/Astroport/video/${MEDIAID}/" "output.mp4" "$G1PUB"
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/Astroport/${PLAYER}/video/${MEDIAID}/" "output.mp4" "$G1PUB"
# https://stackoverflow.com/questions/49846400/raspberry-pi-use-vlc-to-stream-webcam-logitech-c920-h264-video-without-tran
# record to MKV cvlc v4l2:///dev/video0:chroma=h264 :input-slave=alsa://hw:1,0 --sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:standard{access=file,mux=mkv,dst='~/.zen/tmp/Webcam_Record/MyVid.mkv'}'

209
www/G1PalPay/pay.html Normal file
View File

@ -0,0 +1,209 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="icon" type="image/x-icon" href="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/favicon.ico">
<title>♥Box - G1PASS PAY2ACCESS - </title>
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/demo.css">
<script src="http://127.0.0.1:8080/ipfs/QmYD4y1pXHVnGxxFcn2LWo84ytwmWdNbkyUeFnPCbrpUQy/openpgp.min.js"></script>
<script src="http://127.0.0.1:8080/ipfs/Qmae5v9zydax9u6C9ceDijURu5PYdd5avmv4NkenCw7RFv/astro.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/jquery-3.6.3.min.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmQLQ5WdCEc7mpKw5rhUujUU1URKweei4Bb4esyVNd9Atx/G1PalPay_fichiers/instascan.min.js"></script>
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmaCh8mywWfxkXF3JziFzqZS6yZFo3eNS5fSfnzJqdSQvX/decoration.css" type="text/css" />
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmaCh8mywWfxkXF3JziFzqZS6yZFo3eNS5fSfnzJqdSQvX/layout.css" type="text/css" />
<style>
body {
background-image:url("http://127.0.0.1:8080/ipfs/QmPjA3g1ZK45VGGLSudZJ5VVtsGpbmyaokuj17HuPffVHY");
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0;
margin: 0;
font-family: sans-serif;
}
html {
height: 100%
}
header {
opacity: 0.8;
}
input[type=submit] {
width: 12em; height: 4em;
}
input[type=checkbox] {
width: 2em; height: 2em;
}
input {
width: 26em; height: 2em;
}
#aframe {
background: white;
color: black;
}
#yellow {
background: black;
color: white;
position: absolute;
bottom: 2%;
left: 2%;
width: 800px;
visibility: hidden;
}
h1 {
margin-top: 10px;
font-size: 40px;
margin-bottom: 10px;
}
.subtitle {
font-size: 20px;
margin-bottom: 20px;
color: #777;
}
a {
color: white;
}
#demo {
overflow: hidden;
}
#description {
text-align: left;
float: left;
width: 49%;
max-width: 500px;
padding-top: 15px;
padding-left: 20px;
}
#showoff {
float: right;
width: 30%;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#container {
top: 120px;
right: 0px;
position: absolute;
display: inline-block;
width: 400px;
height: 400px;
}
</style>
</head>
<body>
<div id="demo">
<div id="description">
<header>
<h1><a href="http://astroport.localhost:1234"><span>♥Box</span> Ğ1Station</a></h1><br>
<h3>Scannez votre G1PASS !</h3>
<h2>Versez _PRICE_ Ğ1</h2>
<h3>pour accéder à _TITTLE_</h3>
</header>
</div>
</div>
<div id="showoff">
<div id="container">
<video id="preview" style="transform: scaleX(-1);width: 240px;height: 240px;" autoplay="autoplay" class="active"></video>
<p><input type="hidden" id="g1pub" value="DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech"/></p>
<p><input type="text" id="who" value=""/></p>
<div id="appname">
<input type="radio" id="r0" name="appname" value="pay" checked="checked"><p><b>G1PASS</b></p>
</div>
<strong><div id="countdown"></div></strong>
<strong><div id="resu"></div></strong>
</div>
</div>
<script type="text/javascript">
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
scanner.addListener('scan', function (content) {
alert(content);
if (content.startsWith('~~~~~')) {
// GET APPNAME
var appname = document.querySelector('input[name="appname"]:checked').value;
// GET PASS THAT DECODE PGP
var pass = prompt("Saisir PASS:");
// GET DESTINATION
// FROM PREVIOUS G1PUB SCAN
var g1pub = document.getElementById("g1pub").value;
alert('PAY TO ' + g1pub + ' = ' + _PRICE_);
var myU = 'http://astroport.localhost:1234/?qrcode=' + content +'&pass=' + pass + '&palpay=_PRICE_&g1pub=' + g1pub + '&who=' + document.getElementById("who").value ;
console.log(myU);
homeAstroportStation(myU, 'aframe', 10000)
} else {
// COPY QRCODE IN g1pub input
document.getElementById("who").value = content;
}
});
Instascan.Camera.getCameras().then(function (cameras) {
if (cameras.length > 0) {
scanner.start(cameras[0]);
} else {
console.error('No cameras found.');
}
}).catch(function (e) {
console.error(e);
});
</script>
<h1><button id="ainfo" onclick="javascript:var x = document.getElementById('yellow'); if (x.style.visibility === 'hidden') {x.style.visibility = 'visible';} else {x.style.visibility = 'hidden';}">0/1</button></h1>
<div id="yellow" ><a href="_STATION_" target="aframe">MENU</a>
<iframe name="aframe" id="aframe" src="_STATION_" width="100%" height="320px"></iframe>
</div>
<script>
let cookies = document.cookie;
console.log(cookies);
const el = document.getElementById('yellow');
setTimeout(() => {
el.style.visibility = 'visible';
}, 2000); // 👈️ delay in milliseconds
</script>
</body></html>

View File

@ -0,0 +1,356 @@
<html>
<head>
<script>
<!--
function run() {
let myStrSoundStimulation = document.getElementById('LETTER').value
myStrSoundStimulation = myStrSoundStimulation
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '223.8, ')
.replace(/a/g, '265.6, ')
.replace(/s/g, '313.3, ')
.replace(/p/g, '343.2, ')
.replace(/v/g, '349.2, ')
.replace(/t/g, '355.1, ')
.replace(/c/g, '361.1, ')
.replace(/i/g, '391.0, ')
.replace(/l/g, '391.0, ')
.replace(/n/g, '393.8, ')
.replace(/d/g, '396.8, ')
.replace(/q/g, '435.7, ')
.replace(/k/g, '435.8, ')
.replace(/e/g, '438.6, ')
.replace(/m/g, '444.8, ')
.replace(/h/g, '462.5, ')
.replace(/f/g, '492.4, ')
.replace(/r/g, '519.3, ')
.replace(/y/g, '540.1, ')
.replace(/w/g, '608.8, ')
.replace(/S/g, '545.7, ')
.replace(/T/g, '587.5, ')
soundStimulationFrequencies.value = myStrSoundStimulation;
let myStrTemperedNoteStimulation = document.getElementById('LETTER').value
myStrTemperedNoteStimulation = myStrTemperedNoteStimulation
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '220, ')
.replace(/a/g, '261.6, ')
.replace(/s/g, '329.6, ')
.replace(/p/g, '349.2, ')
.replace(/v/g, '349.2, ')
.replace(/t/g, '349.2, ')
.replace(/c/g, '349.2, ')
.replace(/i/g, '392, ')
.replace(/l/g, '392, ')
.replace(/n/g, '392, ')
.replace(/d/g, '392, ')
.replace(/q/g, '440, ')
.replace(/k/g, '440, ')
.replace(/e/g, '440, ')
.replace(/m/g, '440, ')
.replace(/h/g, '466.2, ')
.replace(/f/g, '493.9, ')
.replace(/r/g, '523.3, ')
.replace(/y/g, '523.3, ')
.replace(/w/g, '587.3, ')
temperedNoteStimulationFrequencies.value = myStrTemperedNoteStimulation;
let myStrScalarStimulation = document.getElementById('LETTER').value
myStrScalarStimulation = myStrScalarStimulation
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '14321.9, ')
.replace(/a/g, '16996.7, ')
.replace(/s/g, '20049.2, ')
.replace(/p/g, '21964.6, ')
.replace(/v/g, '22350.8, ')
.replace(/t/g, '22725.8, ')
.replace(/c/g, '23113.1, ')
.replace(/i/g, '25024.7, ')
.replace(/l/g, '25024.7, ')
.replace(/n/g, '25206.0, ')
.replace(/d/g, '25392.9, ')
.replace(/q/g, '27882.6, ')
.replace(/k/g, '27890.3, ')
.replace(/e/g, '28069.6, ')
.replace(/m/g, '28466.4, ')
.replace(/h/g, '29601.6, ')
.replace(/f/g, '31515.1, ')
.replace(/r/g, '33234.0, ')
.replace(/y/g, '34567.6, ')
.replace(/w/g, '38963.2, ')
.replace(/S/g, '34924.3, ')
.replace(/T/g, '37599.1, ')
scalarStimulationFrequencies.value = myStrScalarStimulation;
let myStrXmStimulation = document.getElementById('LETTER').value
myStrXmStimulation = myStrXmStimulation
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '916602.9, ')
.replace(/a/g, '1087786.8, ')
.replace(/s/g, '1283146.4, ')
.replace(/p/g, '1405734.6, ')
.replace(/v/g, '1430398.7, ')
.replace(/t/g, '1454452.4, ')
.replace(/c/g, '1479238.6, ')
.replace(/i/g, '1601582.6, ')
.replace(/l/g, '1601582.6, ')
.replace(/n/g, '1613182.1, ')
.replace(/d/g, '1625147.9, ')
.replace(/q/g, '1784488.0, ')
.replace(/k/g, '1784976.4, ')
.replace(/e/g, '1796453.8, ')
.replace(/m/g, '1821850.6, ')
.replace(/h/g, '1894499.9, ')
.replace(/f/g, '2016966.0, ')
.replace(/r/g, '2126977.9, ')
.replace(/y/g, '2212325.6, ')
.replace(/w/g, '2493643.5, ')
.replace(/S/g, '2235158.3, ')
.replace(/T/g, '2406342.1, ')
xmStimulationFrequencies.value = myStrXmStimulation;
let myStrGxStimulation = document.getElementById('LETTER').value
myStrGxStimulation = myStrGxStimulation
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '7332823.4, ')
.replace(/a/g, '8702294.3, ')
.replace(/s/g, '10265171.3, ')
.replace(/p/g, '11245876.6, ')
.replace(/v/g, '11443189.8, ')
.replace(/t/g, '11635619.1, ')
.replace(/c/g, '11833909.1, ')
.replace(/i/g, '12812660.8, ')
.replace(/l/g, '12812660.8, ')
.replace(/n/g, '12905456.6, ')
.replace(/d/g, '13001182.8, ')
.replace(/q/g, '14275904.3, ')
.replace(/k/g, '14279811.5, ')
.replace(/e/g, '14371630.6, ')
.replace(/m/g, '14574804.6, ')
.replace(/h/g, '15155999.4, ')
.replace(/f/g, '16135727.9, ')
.replace(/r/g, '17015823.0, ')
.replace(/y/g, '17698604.9, ')
.replace(/w/g, '19949147.8, ')
.replace(/S/g, '17881266.2, ')
.replace(/T/g, '19250737.1, ')
gxStimulationFrequencies.value = myStrGxStimulation;
let myStrSoundInhibition = document.getElementById('LETTER').value
myStrSoundInhibition= myStrSoundInhibition
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '707.1, ')
.replace(/a/g, '595.9, ')
.replace(/s/g, '505.1, ')
.replace(/p/g, '461.1, ')
.replace(/v/g, '453.1, ')
.replace(/t/g, '445.6, ')
.replace(/c/g, '438.2, ')
.replace(/i/g, '404.7, ')
.replace(/l/g, '404.7, ')
.replace(/n/g, '401.8, ')
.replace(/d/g, '398.8, ')
.replace(/q/g, '363.2, ')
.replace(/k/g, '363.1, ')
.replace(/e/g, '360.8, ')
.replace(/m/g, '355.8, ')
.replace(/h/g, '342.1, ')
.replace(/f/g, '321.4, ')
.replace(/r/g, '304.7, ')
.replace(/y/g, '293.0, ')
.replace(/w/g, '259.9, ')
.replace(/S/g, '290.3, ')
.replace(/T/g, '270.2, ')
soundInhibitionFrequencies.value = myStrSoundInhibition;
let myStrTemperedNoteInhibition = document.getElementById('LETTER').value
myStrTemperedNoteInhibition = myStrTemperedNoteInhibition
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '698.4, ')
.replace(/a/g, '587.3, ')
.replace(/s/g, '466.2, ')
.replace(/p/g, '440, ')
.replace(/v/g, '440, ')
.replace(/t/g, '440, ')
.replace(/c/g, '440, ')
.replace(/i/g, '392, ')
.replace(/l/g, '392, ')
.replace(/n/g, '392, ')
.replace(/d/g, '392, ')
.replace(/q/g, '349.2, ')
.replace(/k/g, '349.2, ')
.replace(/e/g, '349.2, ')
.replace(/m/g, '349.2, ')
.replace(/h/g, '329.6, ')
.replace(/f/g, '311.1, ')
.replace(/r/g, '293.7, ')
.replace(/y/g, '293.7, ')
.replace(/w/g, '261.6, ')
temperedNoteInhibitionFrequencies.value = myStrTemperedNoteInhibition;
let myStrScalarInhibition = document.getElementById('LETTER').value
myStrScalarInhibition = myStrScalarInhibition
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '45257.2, ')
.replace(/a/g, '38135.1, ')
.replace(/s/g, '32329.0, ')
.replace(/p/g, '29509.8, ')
.replace(/v/g, '29000.9, ')
.replace(/t/g, '28521.3, ')
.replace(/c/g, '28043.4, ')
.replace(/i/g, '25901.2, ')
.replace(/l/g, '25901.2, ')
.replace(/n/g, '25714.9, ')
.replace(/d/g, '25525.6, ')
.replace(/q/g, '23246.4, ')
.replace(/k/g, '23240.0, ')
.replace(/e/g, '23091.5, ')
.replace(/m/g, '22769.6, ')
.replace(/h/g, '21896.5, ')
.replace(/f/g, '20567.0, ')
.replace(/r/g, '19503.2, ')
.replace(/y/g, '18750.8, ')
.replace(/w/g, '16635.4, ')
.replace(/S/g, '18579.1, ')
.replace(/T/g, '17291.9, ')
scalarInhibitionFrequencies.value = myStrScalarInhibition;
let myStrXmInhibition = document.getElementById('LETTER').value
myStrXmInhibition = myStrXmInhibition
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '2896460.8, ')
.replace(/a/g, '2440647.8, ')
.replace(/s/g, '2069058.0, ')
.replace(/p/g, '1888624.2, ')
.replace(/v/g, '1856059.0, ')
.replace(/t/g, '1825363.6, ')
.replace(/c/g, '1794777.6, ')
.replace(/i/g, '1657675.6, ')
.replace(/l/g, '1657675.6, ')
.replace(/n/g, '1645756.2, ')
.replace(/d/g, '1633638.7, ')
.replace(/q/g, '1487768.1, ')
.replace(/k/g, '1487361.0, ')
.replace(/e/g, '1477858.4, ')
.replace(/m/g, '1457256.9, ')
.replace(/h/g, '1401374.8, ')
.replace(/f/g, '1316286.1, ')
.replace(/r/g, '1248205.0, ')
.replace(/y/g, '1200051.4, ')
.replace(/w/g, '1064668.8, ')
.replace(/S/g, '1189063.3, ')
.replace(/T/g, '1106682.1, ')
xmInhibitionFrequencies.value = myStrXmInhibition;
let myStrGXInhibition = document.getElementById('LETTER').value
myStrGXInhibition = myStrGXInhibition
.replace(/[0123456789 \n]/g, '')
.replace(/g/g, '23171686.0, ')
.replace(/a/g, '19525182.1, ')
.replace(/s/g, '16552464.3, ')
.replace(/p/g, '15108993.9, ')
.replace(/v/g, '14848471.8, ')
.replace(/t/g, '14602908.6, ')
.replace(/c/g, '14358221.0, ')
.replace(/i/g, '13261404.8, ')
.replace(/l/g, '13261404.8, ')
.replace(/n/g, '13166049.6, ')
.replace(/d/g, '13069109.5, ')
.replace(/q/g, '11902144.8, ')
.replace(/k/g, '11898888.2, ')
.replace(/e/g, '11822867.3, ')
.replace(/m/g, '11658055.6, ')
.replace(/h/g, '11210998.1, ')
.replace(/f/g, '10530289.2, ')
.replace(/r/g, '9985639.9, ')
.replace(/y/g, '9600411.0, ')
.replace(/w/g, '8517350.4, ')
.replace(/S/g, '9512506.3, ')
.replace(/T/g, '8853456.4, ')
gxInhibitionFrequencies.value = myStrGXInhibition;
}
//-->
</script>
<style>
body {
background: #00B4DB; /* fallback for old browsers */
background: -webkit-linear-gradient(to bottom, #0083B0, #00B4DB); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to bottom, #0083B0, #00B4DB); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
font-style: sans,arial;
margin-left: 20%;
color: #ffffff;
font-family: 'Inconsolata', monospace;
font-size: 19px;
margin-top: 50px;
}
a:link, a:visited {
color: white;
text-decoration: none;
}
</style>
</head>
<title>Protein conversion to frequencies</title>
<body>
<b><center>Protein conversion to frequencies</center></b>
<br>
<br>
<br>This page translates Amino Acid sequence to Frequencies<br>
<br>Paste a protein like this example in the first area below
<br>&nbsp"vitamin D (1,25- dihydroxyvitamin D3) receptor"
<br>&nbsp(https://www.ncbi.nlm.nih.gov/protein/BAH02291.1)<br>
<br>&nbsp&nbsp&nbsp&nbsp&nbsp1 meamaastsl pdpgdfdrnv pricgvcgdr atgfhfnamt cegckgffrr smkrkalftc
<br>&nbsp&nbsp&nbsp&nbsp61 pfngdcritk dnrrhcqacr lkrcvdigmm kefiltdeev qrkremilkr keeealkdsl
<br>&nbsp&nbsp&nbsp121 rpklseeqqr iiailldahh ktydptysdf cqfrppvrvn dgggshpsrp nsrhtpsfsg
<br>&nbsp&nbsp&nbsp181 dsssscsdhc itssdmmdss sfsnldlsee dsddpsvtle lsqlsmlphl adlvsysiqk
<br>&nbsp&nbsp&nbsp241 vigfakmipg frdltsedqi vllkssaiev imlrsnesft mddmswtcgn qdykyrvsdv
<br>&nbsp&nbsp&nbsp301 tkaghsleli eplikfqvgl kklnlheeeh vllmaicivs pdrpgvqdaa lieaiqdrls
<br>&nbsp&nbsp&nbsp361 ntlqtyircr hpppgshlly akmiqkladl rslneehskq yrclsfqpey smkltplvle
<br>&nbsp&nbsp&nbsp421 vfgneis
<br>
<br>then clic on the "Convert to frequencies!" button<br>
<br>then copy the desired result to Spooky software (File\Create program)
<br>chosen from "sound|scalar|XM|GX" range of frequencies and
<br>chosen from "stimulation|inhibition" mode.<br><br>
<br>Copy Amino Acid protein here:<br>
<textarea name="LETTER" id="LETTER" rows="5" cols="100"></textarea>
<br><br><input type="button" onclick="run()" value="Convert to frequencies!" />
<br><br><br><br>Amino acid converted for stimulation sound frequencies:<br>
<textarea name="soundStimulationFrequencies" id="soundStimulationFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for stimulation tempered note frequencies:<br>
<textarea name="temperedNoteStimulationFrequencies" id="temperedNoteStimulationFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for stimulation scalar frequencies:<br>
<textarea name="scalarStimulationFrequencies" id="scalarStimulationFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for stimulation XM frequencies:<br>
<textarea name="xmStimulationFrequencies" id="xmStimulationFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for stimulation GX frequencies:<br>
<textarea name="gxStimulationFrequencies" id="gxStimulationFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for inhibition sound frequencies:<br>
<textarea name="soundInhibitionFrequencies" id="soundInhibitionFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for inhibition tempered note frequencies:<br>
<textarea name="temperedNoteInhibitionFrequencies" id="temperedNoteInhibitionFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for inhibition scalar frequencies:<br>
<textarea name="scalarInhibitionFrequencies" id="scalarInhibitionFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for inhibition XM frequencies:<br>
<textarea name="xmInhibitionFrequencies" id="xmInhibitionFrequencies" rows="5" cols="100"></textarea>
<br><br><br><br>Amino acid converted for inhibition GX frequencies:<br>
<textarea name="gxInhibitionFrequencies" id="gxInhibitionFrequencies" rows="5" cols="100"></textarea>
</body>
</html>

View File

@ -0,0 +1,183 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
button {
width: 80px;
margin-right: 2px;
}
textarea {
font-family: monospace;
min-height: 200px;
}
.form-control[readonly] {
background-color: #ffffff;
}
.no-left-padding {
padding-left: 0 !important;
margin: 0 !important;
}
.no-right-padding {
padding-right: 0 !important;
margin: 0 !important;
}
</style>
<script>
function createSession() {
stopSession()
printLog('Creating session...')
pc = new RTCPeerConnection({
'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }]
})
pc.ontrack = function(event) {
printLog('Accepting new track')
var el = document.createElement(event.track.kind)
el.srcObject = event.streams[0]
el.autoplay = true
el.controls = true
document.getElementById('tracks').appendChild(el)
}
pc.oniceconnectionstatechange = function(event) {
printLog('ICE connection state changed to '+pc.iceConnectionState)
}
pc.addTransceiver('audio', {'direction': 'sendrecv'})
mediaOpts = {
audio: true,
video: false,
}
navigator.mediaDevices.getUserMedia(mediaOpts).
then(addMic).
catch(skipMic)
}
function addMic(stream) {
printLog('Adding microphone to session...')
let track = stream.getTracks()[0]
pc.addTrack(track, stream)
createOffer()
}
function skipMic(err) {
printLog('Skipping microphone configuration: '+err)
createOffer()
}
function createOffer() {
let offerOpts = {
'mandatory': {
'OfferToReceiveAudio': true,
'OfferToReceiveVideo': false,
},
}
pc.createOffer(offerOpts).
then(setLocalDescription).
catch(printLog)
}
function setLocalDescription(offer) {
pc.setLocalDescription(offer).then(setOffer)
}
function setOffer(offer) {
document.getElementById('offer').value = pc.localDescription.sdp
}
function startSession() {
let answer = document.getElementById('answer').value
if (answer === '') {
return printLog('Error: SDP answer is not set')
}
printLog('Starting session...')
let desc = new RTCSessionDescription({
'type': 'answer',
'sdp': answer,
})
pc.setRemoteDescription(desc).catch(printLog)
}
function stopSession() {
if (typeof pc === 'undefined') {
return
}
printLog('Stopping session...')
pc.close()
pc = undefined
document.getElementById('offer').value = ''
document.getElementById('answer').value = ''
document.getElementById('tracks').innerHTML = ''
}
function printLog(msg) {
log = document.getElementById('log')
log.value += msg + '\n'
log.scrollTop = log.scrollHeight
}
</script>
</head>
<body onload="window.createSession()">
<div class="container">
<div class="row">
<h1>WebRTC demo</h1>
</div>
<div class="row">
<div class="col-sm-6 no-left-padding">
<h2>Offer</h2>
<p><i>Copy this to webrtc-cli stdin and press ^D</i></p>
<textarea class="form-control" id="offer" readonly="true"></textarea>
</div>
<div class="col-sm-6 no-right-padding">
<h2>Answer</h2>
<p><i>Paste webrtc-cli stdout here and press "Start"</i></p>
<textarea class="form-control" id="answer"></textarea>
</div>
</div>
<div class="row">
<h2>Session</h2>
<button class="btn btn-primary" onclick="window.startSession()">
Start
</button>
<button class="btn btn-primary" onclick="window.stopSession()">
Stop
</button>
<button class="btn btn-primary" onclick="window.createSession()">
Refresh
</button>
</div>
<div class="row">
<h2>Tracks</h2>
<div id="tracks"></div>
</div>
<div class="row">
<h2>Logs</h2>
<textarea class="form-control" id="log" readonly="true"></textarea>
</div>
</div>
</body>
</html>