chill wrote: > I'm still hacking my way around to get a feel for what needs to be done > to get it working and then redone after a reboot. So far I have it set > up such that pCP runs a script at startup (via the built-in 'User > Command's' tweak) e.g. /home/tc/.ngrok2/ngrok_startup.sh, which starts > ngrok and then finds the URL via that curl command. grep in Busybox > doesn't have the -P option, but I can get to the url with a bit of > awking: > > Code: -------------------- > > curl -s http://localhost:4040/api/tunnels | awk -F"https:// {'print $2'} | awk -F" {'print $1'} -------------------- > > > > I haven't attempted to make it a service, because this User Command > script seems sufficient - I can run the script manually if I ever need > to run it without a reboot, but since this RPi3 is currently dedicated > to ngrok only, a reboot is fine. > > I haven't got the python script working yet - it's failing at 'import > requests' and I can't see whether that, or json or urllib.parse, are > included in any of the python packages that are available for pCP. To > be investigated later if necessary. > > I have installed the Alexa app on my iPhone and MediaServer is one of > 'my' skills, and seems to have linked successfully, but since I don't > have a device yet I can't test it any further. And I also can't tell > what the final step of the python script should be doing, once it's > recovered the url. Maybe I can do that too with simple shell > scripting, but I need to find out what the python would do first.
Would the Perl not be easier than Python, given that pCP needs Perl itself? All the script does is a HTTPS GET to a specific url with some url parameters filled out. It can be done from any language. If it helps you at all, I have a tiny sh script that does it too. pCP has sh available. ------------------------------------------------------------------------ philchillbill's Profile: http://forums.slimdevices.com/member.php?userid=68920 View this thread: http://forums.slimdevices.com/showthread.php?t=111016 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
