(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:currentVersion) op:Equal rhs:{(DQ (1.11.1))} spids:[7])] spids: [7] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:configuredClient) op:Equal rhs:{(DQ )} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:configuredPython) op:Equal rhs:{(DQ )} spids:[16])] spids: [16] ) (C {(source)} {(TildeSubPart prefix:'') (/.bash_profile)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:apiKey) op: Equal rhs: {($ VSub_Name '$TASTE_API_KEY')} spids: [28] ) ] spids: [28] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:info) op:Equal rhs:{(DQ (0))} spids:[31])] spids: [31] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:search) op:Equal rhs:{(DQ (0))} spids:[39])] spids: [39] ) (FuncDef name: getConfiguredClient body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(command)} {(-v)} {(curl)}) terminator: <Op_Amp '&'> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [67] ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (curl))} spids: [75] ) ] spids: [75] ) ] spids: [16777215 72] ) (if_arm cond: [ (Sentence child: (C {(command)} {(-v)} {(wget)}) terminator: <Op_Amp '&'> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [90] ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (wget))} spids: [98] ) ] spids: [98] ) ] spids: [81 95] ) (if_arm cond: [ (Sentence child: (C {(command)} {(-v)} {(fetch)}) terminator: <Op_Amp '&'> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [113] ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (fetch))} spids: [121] ) ] spids: [121] ) ] spids: [104 118] ) ] else_action: [ (C {(echo)} {(DQ ('Error: This tool reqires either curl, wget, or fetch to be installed.'))} ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [127 142] ) ] spids: [55] ) spids: [51 54] ) (FuncDef name: getConfiguredPython body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(command)} {(-v)} {(python2)}) terminator: <Op_Amp '&'> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [163] ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredPython) op: Equal rhs: {(DQ (python2))} spids: [171] ) ] spids: [171] ) ] spids: [16777215 168] ) (if_arm cond: [ (Sentence child: (C {(command)} {(-v)} {(python)}) terminator: <Op_Amp '&'> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [186] ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredPython) op: Equal rhs: {(DQ (python))} spids: [194] ) ] spids: [194] ) ] spids: [177 191] ) ] else_action: [ (C {(echo)} {(DQ ('Error: This tool requires python 2 to be installed.'))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [200 215] ) ] spids: [151] ) spids: [147 150] ) (FuncDef name: python body: (BraceGroup children: [ (Case to_match: {(DQ ($ VSub_Name '$configuredPython'))} arms: [ (case_arm pat_list: [{(python2)}] action: [(C {(python2)} {(DQ ($ VSub_At '$@'))})] spids: [237 238 245 16777215] ) (case_arm pat_list: [{(python)}] action: [(C {(python)} {(DQ ($ VSub_At '$@'))})] spids: [248 249 256 16777215] ) ] spids: [228 234 259] ) ] spids: [225] ) spids: [221 224] ) (FuncDef name: httpGet body: (BraceGroup children: [ (Case to_match: {(DQ ($ VSub_Name '$configuredClient'))} arms: [ (case_arm pat_list: [{(curl)}] action: [(C {(curl)} {(-A)} {(curl)} {(-s)} {(DQ ($ VSub_At '$@'))})] spids: [283 284 297 16777215] ) (case_arm pat_list: [{(wget)}] action: [(C {(wget)} {(-qO-)} {(DQ ($ VSub_At '$@'))})] spids: [300 301 310 16777215] ) (case_arm pat_list: [{(fetch)}] action: [(C {(fetch)} {(-o)} {(DQ (...))})] spids: [313 314 323 16777215] ) ] spids: [274 280 326] ) ] spids: [271] ) spids: [267 270] ) (FuncDef name: checkInternet body: (BraceGroup children: [ (Pipeline children: [ (C {(echo)} {(-e)} {(DQ ('GET http://google.com HTTP/1.0') (Lit_Other '\\') (n) (Lit_Other '\\') (n))} ) (SimpleCommand words: [{(nc)} {(google.com)} {(80)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [359] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[363]) ] ) ] negated: F ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-eq)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] spids: [16777215 383] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ ('Error: no active internet connection'))}] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[403])] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [394 415] ) ] spids: [336] ) spids: [332 335] ) (FuncDef name: update body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repositoryName) op: Equal rhs: {(DQ (Bash-Snippets))} spids: [439] ) ] spids: [439] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:githubUserName) op: Equal rhs: {(DQ (alexanderepstein))} spids: [448] ) ] spids: [448] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nameOfInstallFile) op: Equal rhs: {(DQ (install.sh))} spids: [457] ) ] spids: [457] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:latestVersion) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(httpGet)} {(https) (Lit_Other ':') (//api.github.com/repos/) ($ VSub_Name '$githubUserName') (/) ($ VSub_Name '$repositoryName') (/tags) } ) (C {(grep)} {(-Eo)} {(SQ <'"name":.*?[^\\\\]",'>)}) (C {(head)} {(-1)}) (C {(grep)} {(-Eo)} {(DQ ('[0-9.]+'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [467 503] ) } spids: [466] ) ] spids: [466] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$currentVersion')} right: {(DQ )} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$repositoryName')} right: {(DQ )} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$githubUserName')} right: {(DQ )} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$nameOfInstallFile')} right: {(DQ )} ) ) ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Error: update utility has not been configured correctly.'))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[559])] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 550] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$latestVersion')} right: {(DQ )} ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ('Error: no active internet connection'))}] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[590])] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [568 581] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name '$latestVersion'))} right: {(DQ ($ VSub_Name '$currentVersion'))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$latestVersion') (' available'))}) (C {(echo)} {(-n)} { (DQ ('Do you wish to update ') ($ VSub_Name '$repositoryName') (' [Y/n]: ')) } ) (C {(read)} {(-r)} {(answer)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name '$answer'))} right: {(DQ (Y))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Name '$answer'))} right: {(DQ (y))} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(TildeSubPart prefix:'')}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(SQ <'Update Failed'>)}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [687] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_d child: {(Lit_Tilde '~') (/) ($ VSub_Name '$repositoryName') } ) ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (AndOr ops: [Op_DPipe] children: [ (C {(rm)} {(-r)} {(-f)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ( 'Permissions Error: try running the update as sudo' ) ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [731] ) ] ) terminator: <Op_Semi ';'> ) ] spids: [16777215 719] ) ] spids: [16777215 749] ) (AndOr ops: [Op_DPipe] children: [ (C {(git)} {(clone)} { (DQ ('https://github.com/') ($ VSub_Name '$githubUserName') (/) ($ VSub_Name '$repositoryName') ) } ) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ("Couldn't download latest version"))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [765] ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(SQ <'Update Failed'>)}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [789] ) ] ) (AndOr ops: [Op_DPipe Op_DPipe] children: [ (SimpleCommand words: [ {(git)} {(checkout)} {(DQ (v) ($ VSub_Name '$latestVersion'))} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [816] ) ] ) (SimpleCommand words: [{(git)} {(checkout)} {(DQ ($ VSub_Name '$latestVersion'))}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [830] ) ] ) (C {(echo)} { (DQ ( "Couldn't git checkout to stable release, updating to latest commit." ) ) } ) ] ) (C {(chmod)} {(a) (Lit_Other '+') (x)} {(install.sh)}) (AndOr ops: [Op_DPipe] children: [ (C {(./) ($ VSub_Name '$nameOfInstallFile')} {(DQ (update))}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (C {(cd)} {(..)}) (AndOr ops: [Op_DPipe] children: [ (C {(rm)} {(-r)} {(-f)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} { (DQ ( 'Permissions Error: update succesfull but cannot delete temp files located at ~/' ) ($ VSub_Name '$repositoryName') (' delete this directory with sudo') ) } ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [884] ) ] ) ] spids: [16777215 678] ) ] else_action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] spids: [903 911] ) ] spids: [16777215 619] ) ] else_action: [ (C {(echo)} {(DQ ($ VSub_Name '$repositoryName') (' is already the latest version'))} ) ] spids: [914 925] ) ] spids: [599 928] ) ] spids: [424] ) spids: [420 423] ) (FuncDef name: getSimilar body: (BraceGroup children: [ (C {(export)} {(Lit_VarLike 'PYTHONIOENCODING=') (utf8)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:media) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_At '$@'))}) (C {(tr)} {(DQ (' '))} {(Lit_Other '+')}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [954 972] ) } spids: [953] ) ] spids: [953] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:response) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(httpGet)} { (DQ ('https://tastedive.com/api/similar?q=') ($ VSub_Name '$media') ('&k=') ($ VSub_Name '$apiKey') ('&info=') ($ VSub_Name '$info') ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [976 987] ) } spids: [975] ) ] spids: [975] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nameOne) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (AndOr ops: [Op_DPipe] children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['Name']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1010] ) ] ) ] negated: F ) (BraceGroup children: [ (Sentence child: (C {(echo)} {(DQ ('Error: Did you search a valid item?'))}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [1016] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [995 1032] ) } spids: [994] ) ] spids: [994] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:typeOne) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['Type']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1051] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1036 1054] ) } spids: [1035] ) ] spids: [1035] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nameTwo) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][1]['Name']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1073] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1058 1076] ) } spids: [1057] ) ] spids: [1057] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:typeTwo) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][1]['Type']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1095] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1080 1098] ) } spids: [1079] ) ] spids: [1079] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nameThree) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['Name']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1117] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1102 1120] ) } spids: [1101] ) ] spids: [1101] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:typeThree) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['Type']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1139] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1124 1142] ) } spids: [1123] ) ] spids: [1123] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$info')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:wikiOne) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['wTeaser']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1181] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1166 1184] ) } spids: [1165] ) ] spids: [1165] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:wikiTwo) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][1]['wTeaser']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1203] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1188 1206] ) } spids: [1187] ) ] spids: [1187] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:wikiThree) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][2]['wTeaser']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1225] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1210 1228] ) } spids: [1209] ) ] spids: [1209] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:youtube) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (SimpleCommand words: [ {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Results'][0]['yUrl']" ) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1247] ) ] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1232 1250] ) } spids: [1231] ) ] spids: [1231] ) ] spids: [16777215 1159] ) ] spids: [16777215 1253] ) ] spids: [941] ) spids: [937 940] ) (FuncDef name: getInfo body: (BraceGroup children: [ (C {(export)} {(Lit_VarLike 'PYTHONIOENCODING=') (utf8)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:media) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_At '$@'))}) (C {(tr)} {(DQ (' '))} {(Lit_Other '+')}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1278 1296] ) } spids: [1277] ) ] spids: [1277] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:response) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(httpGet)} { (DQ ('https://tastedive.com/api/similar?q=') ($ VSub_Name '$media') ('&k=') ($ VSub_Name '$apiKey') ('&info=') ($ VSub_Name '$info') ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [1300 1311] ) } spids: [1299] ) ] spids: [1299] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (C {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Info'][0]['Name']" ) ) } ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1315 1329] ) } spids: [1314] ) ] spids: [1314] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:type) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (C {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Info'][0]['Type']" ) ) } ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1333 1347] ) } spids: [1332] ) ] spids: [1332] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$info')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:wiki) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (C {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Info'][0]['wTeaser']" ) ) } ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1369 1383] ) } spids: [1368] ) ] spids: [1368] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:youtube) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$response')}) (C {(python)} {(-c)} { (DQ ( "import sys, json; print json.load(sys.stdin)['Similar']['Info'][0]['yUrl']" ) ) } ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1387 1401] ) } spids: [1386] ) ] spids: [1386] ) ] spids: [16777215 1365] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:wiki) op: Equal rhs: {(DQ (None))} spids: [1407] ) ] spids: [1407] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:youtube) op: Equal rhs: {(DQ (None))} spids: [1413] ) ] spids: [1413] ) ] spids: [1404 1419] ) ] spids: [1265] ) spids: [1261 1264] ) (FuncDef name: printResults body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$info')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('==================================='))}) (C {(echo)}) (C {(echo)} {($ VSub_Name '$nameOne') (Lit_Other ':')} {($ VSub_Name '$typeOne')}) (C {(echo)} {($ VSub_Name '$wikiOne')}) (C {(echo)}) (C {(echo)}) (C {(echo)} {($ VSub_Name '$nameTwo') (Lit_Other ':')} {($ VSub_Name '$typeTwo')}) (C {(echo)} {($ VSub_Name '$wikiTwo')}) (C {(echo)}) (C {(echo)}) (C {(echo)} {($ VSub_Name '$nameThree') (Lit_Other ':')} {($ VSub_Name '$typeThree')} ) (C {(echo)} {($ VSub_Name '$wikiThree')}) (C {(echo)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {($ VSub_Name '$youtube')} right: {(DQ (None))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (C {(echo)} {($ VSub_Name '$youtube')}) terminator: <Op_Semi ';'> ) ] spids: [16777215 1526] ) ] spids: [16777215 1532] ) (C {(echo)}) (C {(echo)} {(DQ ('==================================='))}) ] spids: [16777215 1445] ) ] else_action: [ (C {(echo)} {(DQ ('==================================='))}) (C {(echo)} {($ VSub_Name '$nameOne') (Lit_Other ':')} {($ VSub_Name '$typeOne')}) (C {(echo)} {($ VSub_Name '$nameTwo') (Lit_Other ':')} {($ VSub_Name '$typeTwo')}) (C {(echo)} {($ VSub_Name '$nameThree') (Lit_Other ':')} {($ VSub_Name '$typeThree')}) (C {(echo)} {(DQ ('==================================='))}) ] spids: [1545 1586] ) ] spids: [1428] ) spids: [1424 1427] ) (FuncDef name: printInfo body: (BraceGroup children: [ (C {(echo)} {(DQ ('==================================='))}) (C {(echo)}) (C {(echo)} {($ VSub_Name '$name') (Lit_Other ':')} {($ VSub_Name '$type')}) (C {(echo)} {($ VSub_Name '$wiki')}) (C {(echo)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {($ VSub_Name '$youtube')} right: {(DQ (None))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (C {(echo)} {($ VSub_Name '$youtube')}) terminator: <Op_Semi ';'> ) ] spids: [16777215 1638] ) ] spids: [16777215 1644] ) (C {(echo)} {(DQ ('==================================='))}) ] spids: [1595] ) spids: [1591 1594] ) (FuncDef name: usage body: (BraceGroup children: [ (C {(echo)} {(DQ (Taste))}) (C {(echo)} { (DQ ( 'Description: A recommendation engine that provides 3 similar items based on some input topic.' ) ) } ) (C {(echo)} {(DQ (' Taste also has the ability to provide information on the item of interest.'))} ) (C {(echo)} {(DQ (' Supports: shows, books, music, artists, movies, authors, games'))}) (C {(echo)} {(DQ ('Usage: taste [flag] [item]'))}) (C {(echo)} {(DQ (' -i Get more information on similar items'))}) (C {(echo)} {(DQ (' -s Get information on the item itself'))}) (C {(echo)} {(DQ (' -u Update Bash-Snippet Tools'))}) (C {(echo)} {(DQ (' -h Show the help'))}) (C {(echo)} {(DQ (' -v Get the tool version'))}) (C {(echo)} {(DQ ('Examples:'))}) (C {(echo)} {(DQ (' taste -i Kendrick Lamar'))}) (C {(echo)} {(DQ (' taste Catcher in the Rye'))}) (C {(echo)} {(DQ (' taste -s Red Hot Chili Peppers'))}) ] spids: [1661] ) spids: [1657 1660] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{($ VSub_Name '$apiKey')} right:{(DQ )}) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ('Error: API key not setup properly'))}) (C {(echo)} {(DQ ('To get an API key visit https://tastedive.com/account/api_access'))}) (C {(echo)} { (SQ < 'After getting the API key run the following command: export TASTE_API_KEY="yourAPIKeyGoesHere"' > ) } ) (C {(echo)} { (DQ ( 'After following all the steps and issues still persist try adding export TASTE_API_KEY manually to your .bash_profile' ) ) } ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1777] ) ] spids: [16777215 1812] ) (AndOr ops: [Op_DPipe] children: [(C {(getConfiguredPython)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (AndOr ops: [Op_DPipe] children: [(C {(getConfiguredClient)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (AndOr ops: [Op_DPipe] children: [(C {(checkInternet)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (While cond: [(Sentence child:(C {(getopts)} {(DQ (uvhis))} {(opt)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [ (Case to_match: {($ VSub_Name '$opt')} arms: [ (case_arm pat_list: [{(EscapedLiteralPart token:<Lit_EscapedChar '\\?'>)}] action: [ (SimpleCommand words: [{(echo)} {(DQ ('Invalid option: -') ($ VSub_Name '$OPTARG'))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 16777215 arg_word: {(2)} spids: [1872] ) ] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [1861 1862 1881 16777215] ) (case_arm pat_list: [{(h)}] action: [(C {(usage)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [1884 1885 1896 16777215] ) (case_arm pat_list: [{(v)}] action: [ (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$currentVersion'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] spids: [1899 1900 1916 16777215] ) (case_arm pat_list: [{(u)}] action: [(C {(update)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [1919 1920 1931 16777215] ) (case_arm pat_list: [{(i)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$search')} right: {(DQ (0))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:info) op: Equal rhs: {(DQ (1))} spids: [1955] ) ] spids: [1955] ) ] spids: [16777215 1952] ) ] else_action: [ (C {(echo)} { (DQ ( 'Error: the options -i and -s are mutually exclusive (-s already uses -i)' ) ) } ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [1961 1976] ) ] spids: [1934 1935 1979 16777215] ) (case_arm pat_list: [{(s)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {($ VSub_Name '$info')} right: {(DQ (1))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:search) op: Equal rhs: {(DQ (1))} spids: [2003] ) ] spids: [2003] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:info) op: Equal rhs: {(DQ (1))} spids: [2009] ) ] spids: [2009] ) ] spids: [16777215 2000] ) ] else_action: [ (C {(echo)} { (DQ ( 'Error: the options -i and -s are mutually exclusive (-s already uses -i)' ) ) } ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [2015 2030] ) ] spids: [1982 1983 2033 16777215] ) (case_arm pat_list: [{(Lit_Other ':')}] action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Option -') ($ VSub_Name '$OPTARG') (' requires an argument.'))} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: 16777215 arg_word: {(2)} spids: [2048] ) ] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [2036 2037 2057 16777215] ) ] spids: [1854 1858 2060] ) ] spids: [1851 2062] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id:BoolBinary_GlobDEqual left:{($ VSub_Pound '$#')} right:{(0)}) ) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] spids: [16777215 2078] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$1')} right: {(DQ (update))} ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(update)})] spids: [2083 2097] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$1')} right: {(DQ (help))} ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] spids: [2102 2116] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$search')} right: {(DQ (0))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$info')} right: {(DQ (0))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getSimilar)} {(DQ ($ VSub_At '$@'))}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (C {(printResults)}) ] spids: [16777215 2155] ) ] else_action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getSimilar)} { (DQ (BracedVarSub token: <VSub_At '@'> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)})) spids: [2183 2187] ) ) } ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (C {(printResults)}) ] spids: [2177 2200] ) ] spids: [16777215 2138] ) ] else_action: [ (AndOr ops: [Op_DPipe] children: [ (C {(getInfo)} { (DQ (BracedVarSub token: <VSub_At '@'> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)})) spids: [2209 2213] ) ) } ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (C {(printInfo)}) ] spids: [2203 2229] ) ] spids: [2121 2231] ) ] )