I thought you have, you havent test it?
Anton
I thought you have, you havent test it?
Anton
yes I did and it was not working, thought you were suggesting to change to curl or something
No, I was suggesting maybe you need to test your handler.php with http post, browsing it is testing with http get not post
So dont use playSMS, use curl for example to directly access handler.php but make sure its using http post
Anton
I get the expected response!
More ideas please
So you have tested your script with http post? May I ask how did you do it?
Anton
I did
curl --data “param=9” http://10.18.214.39/handler.php
and I got
root@raspberrypi:/home/pi# curl --data "param=9" http://10.18.214.39/handler.php
<script type="text/javascript" src="https://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://signage.me/demo/sendCommand.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
sendCommand("galaxy.signage.me", "xxxx@xxxx.xxx", "ppppppp", "12", "new1", (thanos = "9"));
});
</script>
was handler.php
working as you’d expected ?
The point of using SMS custom is when you send SMS to playSMS, playSMS will access your script and your script will do something
anton
was it suppose to execute same way it does via browser?
I guess the problem is in file_get_contents
. your handler.php outputting a javascript that should be processed by a browser, in this case accessing via browser aparently different from accessing using file_get_contents()
file_get_contents()
simply ignore those javascript that your handler.php
returned, while using a browser the browser will then execute those javascripts
anton
It sounds so very right, walk around to get it to work i.e. execute javascript???
a quick browsing you’ll get Phantom.js
, as suggested here:
anton
could you elaborate on how to use please?
in playSMS you can use SMS command, so instead of playSMS browsing handler.php, playSMS will execute a shell script that is running phantom js
you need to know how to use phantom js:
http://phantomjs.org/quick-start.html
beyond this is not playSMS issue, so you need to get info somewhere else
btw, phantom js is just one solution, I believe there are other ways to do this, that is to run a javascript from headless browser, or perhaps run a browser from command line
anton