Press javascript button on webpage using curl & bash -


my first post here, please if topic answered elsewhere let me know. found similar posts didn't manage use them solve problem.

background: use iptv service provider offers possibility watch tv channels on rpi running kodi. provider promotes usage of iptv simple client playlist urls. making thinks shorter, playlists generated account , bound public ip address. problem, don't have , want have fix public ip address, everytime isp resets dsl connection have login on iptv provider page , press on called "update ip" button. that's annoying!! want automate bash script triggered dynamic dns service update runs on regular basis on rpi.

what managed far: - use bash command curl login on webpage , save cookie text file. this:

 curl -c cookie.txt -d "user=mymail@mail.com" -d "pass=mypass" http://www.spicetvbox.ro/user/login 

and tried several ways press "update ip" button with:

 curl -b cookie.txt  -d "press=updateip" http://www.spicetvbox.ro/user/xbmc  curl -b cookie.txt  -d "button=upfate ip" http://www.spicetvbox.ro/user/xbmc  curl -b cookie.txt -x post   http://www.spicetvbox.ro/user/xbmc 

and allot of other commands this. tried use firebug inspect button element.. , html firebug:

<form id="formxbupd89942" class="jqvalidation" role="form" novalidate="novalidate" action="http://www.spicetvbox.ro/user/xbmc" method="post"> <input type="hidden" value="updateip" name="run"> <input type="hidden" value="89942" name="id"> <button class="btn btn-info btn-xs" type="submit"> <i class="fa fa-refresh"></i>   update ip </button> 

please give me advice on how press button curl.

you don't need click button - need submit form, or @ least achieve same effect.

use curl http post http://www.spicetvbox.ro/user/xbmc - this:

curl -b cookie.txt --data "run=updateip&id=89942" http://www.spicetvbox.ro/user/xbmc 

this data taken value of form fields , url taken action attribute of form element. when --data (equivalent -d) specified, curl performs post.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -