0

Im using spotify plugin called spop located: https://github.com/Schnouki/spop

Now im tying to make a search system that passes commands and returns the string and then i can parse it and make it readable etc.

If i do the below it works, returns what i want:

echo shell_exec('echo hello'); //returns hello

Now i want to do (Returns nothing):

echo shell_exec('echo search "new release 2017" >/dev/tcp/localhost/6602'); //Returns nothing

Any idea? Now i tried the <pre>$output</pre>. Described: http://php.net/manual/en/function.shell-exec.php#example-4218

I just want to return the output of the search command. I should receive stuff like:

{"query":"new release 2017","uri":"spotify:search:new+release+2017","total_tracks":12,"tracks":[{"artist":"Suresh Parik","title":"Aa Dado Sa Ri Laadli","album":"Rajasthani New Release 2017","duration":382000,"uri":"spotify:track:43tKsH7K2FUOSd4mnutx3m","available":true,"popularity":0,"index":1},{"artist":"Shyam Singh","title":"Bhajan Me Java Koni De","album":"Rajasthani New Release 2017","duration":338000,"uri":"spotify:track:4AdNsTGLKfyAehLXrXmSUK","available":true,"popularity":0,"index":2},{"artist":"Hamira Ram Raika","title":"Bhanwar Sa Mhasu Milta Jaijo","album":"Rajasthani New Release 2017","duration":370000,"uri":"spotify:track:7hEeZk8Fvb8AFd2ps553lq","available":true,"popularity":0,"index":3},{"artist":"Hamira Ram Raika","title":"Dhola Dhola Dhotiya","album":"Rajasthani New Release 2017","duration":416000,"uri":"spotify:track:5YnLliPcOm4Qb1ay2SiTPm","available":true,"popularity":0,"index":4},{"artist":"Papu Artiya","title":"Doda Mat Pi Dokriya","album":"Rajasthani New Release 2017","duration":359000,"uri":"spotify:track:3EjwwyV5qUPffTRUdeOQGV","available":true,"popularity":0,"index":5},{"artist":"Kuldeep Ojha","title":"Gora Gora Gaal","album":"Rajasthani New Release 2017","duration":528000,"uri":"spotify:track:4WlHzN1FSXygCpuPqGLGvY","available":true,"popularity":0,"index":6},{"artist":"Hamira Ram Raika","title":"Jorji Champawat","album":"Rajasthani New Release 2017","duration":557000,"uri":"spotify:track:0ixmKnWl9E2adeEvbHqD6k","available":true,"popularity":0,"index":7},{"artist":"Natwar Jhitra","title":"Maa Ka Palda Bhari Hai","album":"Rajasthani New Release 2017","duration":654000,"uri":"spotify:track:33t5kA8V5dmzdcyWPfy4th","available":true,"popularity":0,"index":8},{"artist":"Ramesh Lohiya","title":"Mele Khele Jao Bhanwar Ji","album":"Rajasthani New Release 2017","duration":304000,"uri":"spotify:track:0JodbnP1tyX6oorRmWOkxC","available":true,"popularity":0,"index":9},{"artist":"Nena Ram Dewasi, Chhotu Banna","title":"Nach Nach Mhara Sang Ra Sathi","album":"Rajasthani New Release 2017","duration":285000,"uri":"spotify:track:5FQKtFPwOYUHaNDAtN9sWn","available":true,"popularity":0,"index":10},{"artist":"Kamlesh Singh","title":"Odh Lugadi Pilo Byayan","album":"Rajasthani New Release 2017","duration":404000,"uri":"spotify:track:2VPNimxfZOmb33kChjcm2c","available":true,"popularity":0,"index":11},{"artist":"Adrian Zenith","title":"Release Yourself - Digital Energy Remix","album":"Happy New Year from Trance of Ibiza 2017","duration":497000,"uri":"spotify:track:4krqyIAazX3R1TVbBxyTB5","available":true,"popularity":0,"index":12}],"total_albums":1,"albums":[{"artist":"Various Artists","title":"Rajasthani New Release 2017","available":true,"uri":"spotify:album:0u1e7VZzl59NWxvIdWyquT"}],"total_artists":0,"artists":[],"total_playlists":6,"playlists":[{"name":"Winter 2017 Country playlist","uri":"spotify:user:1228804577:playlist:0Yzxp6mxnuBfrtVzlxG03h"},{"name":"Top New Songs 2017","uri":"spotify:user:22geympzgpcckueuh7ry6rvqy:playlist:7CPOFZtGed5SE0XhMHmiep"},{"name":"2017 New Release","uri":"spotify:user:teamwork1:playlist:1iJy5jsCvHpp1jDWLtDhIE"},{"name":"2017 New Release & Hit Parade","uri":"spotify:user:12150104486:playlist:6n75nX7NBRCn2cXsmT4eHf"},{"name":"Jetsetter 2017 (EDM Elixir) | Updated Weekly","uri":"spotify:user:126414896:playlist:0JUtq7lLoahjuXZQARW13U"},{"name":"UNFD 2017","uri":"spotify:user:unfdcentral:playlist:2Lbl7gTrFYREhHEGUV4ZNZ"}]}
William
  • 1,009
  • 15
  • 41
  • if you type `'echo search "new release 2017" >/dev/tcp/localhost/6602'` on terminal what do you get on terminal ??? – M A SIDDIQUI Feb 10 '17 at 13:58
  • It runs but no output. Just brings me to a new line. Now, if i do `echo next >/dev/tcp/localhost/6602` it skips to the next song. So it works but just wont output! :/ – William Feb 10 '17 at 14:01
  • 1
    shell_exec($commanad) excutes the given command and return only what you see if you run the same command on terminal. As you don't see any output on terminal ... It won't show anything – M A SIDDIQUI Feb 10 '17 at 14:02
  • I was afraid that would be the case, how / what can i do to accomplish what i need? Do you have any ideas? Would love to hear as i am out of them! – William Feb 10 '17 at 14:04
  • The json content you have given where they come from ??? – M A SIDDIQUI Feb 10 '17 at 14:06
  • If i open the tunnel in the terminal:`telnet localhost 6602` if i then enter: `search 'new release 2017'` it returns the big query. I was hoping to some how output so i can parse it. – William Feb 10 '17 at 14:10
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/135390/discussion-between-m-a-siddiqui-and-irishwill200). – M A SIDDIQUI Feb 10 '17 at 14:12
  • Anyone else have ideas? Much appreciated. – William Feb 10 '17 at 16:18

0 Answers0