2
0
Fork 0
mirror of https://github.com/alexanderepstein/Bash-Snippets synced 2018-11-08 02:59:35 +01:00

Only one unique youtube link amongst the three

This commit is contained in:
Alex Epstein 2017-06-30 02:56:56 -04:00
parent c4a29d17fe
commit 41740edb2e

View file

@ -100,11 +100,9 @@ getSimilar()
typeThree=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['Type']") typeThree=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['Type']")
if [[ $info == "1" ]];then if [[ $info == "1" ]];then
wikiOne=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['wTeaser']") wikiOne=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['wTeaser']")
youtubeOne=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['yUrl']")
wikiTwo=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][1]['wTeaser']") wikiTwo=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][1]['wTeaser']")
youtubeTwo=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][1]['yUrl']")
wikiThree=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['wTeaser']") wikiThree=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['wTeaser']")
youtubeThree=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['yUrl']") youtube=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['yUrl']")
fi fi
} }
@ -132,17 +130,15 @@ printResults()
echo $nameOne: $typeOne echo $nameOne: $typeOne
echo $wikiOne echo $wikiOne
echo echo
if [[ $youtubeOne != "None" ]];then echo $youtubeOne;fi
echo echo
echo $nameTwo: $typeTwo echo $nameTwo: $typeTwo
echo $wikiTwo echo $wikiTwo
echo echo
if [[ $youtubeTwo != "None" ]];then echo $youtubeOne;fi
echo echo
echo $nameThree: $typeThree echo $nameThree: $typeThree
echo $wikiThree echo $wikiThree
echo echo
if [[ $youtubeThree != "None" ]];then echo $youtubeOne;fi if [[ $youtube != "None" ]];then echo $youtube;fi
echo echo
echo "===================================" echo "==================================="
else else