From 41740edb2e5a4af10331844a9233b452f183c450 Mon Sep 17 00:00:00 2001 From: Alex Epstein Date: Fri, 30 Jun 2017 02:56:56 -0400 Subject: [PATCH] Only one unique youtube link amongst the three --- taste/taste | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/taste/taste b/taste/taste index 2743247..e402932 100755 --- a/taste/taste +++ b/taste/taste @@ -100,11 +100,9 @@ getSimilar() typeThree=$(echo $response | python -c "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['Type']") if [[ $info == "1" ]];then 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']") - 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']") - 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 } @@ -132,17 +130,15 @@ printResults() echo $nameOne: $typeOne echo $wikiOne echo - if [[ $youtubeOne != "None" ]];then echo $youtubeOne;fi echo echo $nameTwo: $typeTwo echo $wikiTwo echo - if [[ $youtubeTwo != "None" ]];then echo $youtubeOne;fi echo echo $nameThree: $typeThree echo $wikiThree echo - if [[ $youtubeThree != "None" ]];then echo $youtubeOne;fi + if [[ $youtube != "None" ]];then echo $youtube;fi echo echo "===================================" else