volkscom
Posts: 3
Joined: Tue Jan 28, 2014 11:18 am

Reload webpage on midori browser through SSH

Tue Jan 28, 2014 11:49 am

Hi,
I'm doing a digital signage project using raspberry pi and hence I've to run the browser from the boot time. I'm using midori web browser and it works pretty well. Now the problem is this, I've to reload the page at certain times when new files are uploaded. I've tried the code

Code: Select all

midori -e Reload
but it won't work in my case.(Saw somewhere else like that this code will work only for windows opened by double click on the icon). Can anyone suggest a solution for this?

Thanks in advance....
Volkscom...
Last edited by volkscom on Wed Jan 29, 2014 7:00 am, edited 1 time in total.

Angelus88
Posts: 442
Joined: Mon May 13, 2013 9:25 am
Location: Ivrea, TO (Italy)

Re: Auto reload midori browser

Tue Jan 28, 2014 2:07 pm

If you have access to that webpage, you could edit the HTML code to insert a javascript that keeps reloading the page every 15 sec. or whatever

volkscom
Posts: 3
Joined: Tue Jan 28, 2014 11:18 am

Re: Auto reload midori browser

Wed Jan 29, 2014 7:04 am

Angelus88 wrote:If you have access to that webpage, you could edit the HTML code to insert a javascript that keeps reloading the page every 15 sec. or whatever
Sorry Angelus88... Actually I want to reload the page whenever new files are uploaded. I have updated the title. I am trying to do it through ssh. Hope there is a solution for this. Thanks for your time.

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Reload webpage on midori browser through SSH

Wed Jan 29, 2014 7:08 am

There are command line tools that will emulate mouse clicks, you could try making a loop every 15 second that would click that icon. I am using xdotool to emulate mouse clicks, it has a lot of options that mean you can also reposition the mouse pointer on a page. I don't know if it would work with midori, but you could try. There are a lot of tutorials on the web for using xdotool, and the man page is very good.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Angelus88
Posts: 442
Joined: Mon May 13, 2013 9:25 am
Location: Ivrea, TO (Italy)

Re: Reload webpage on midori browser through SSH

Wed Jan 29, 2014 7:39 am

sdjf wrote:There are command line tools that will emulate mouse clicks, you could try making a loop every 15 second that would click that icon. I am using xdotool to emulate mouse clicks, it has a lot of options that mean you can also reposition the mouse pointer on a page. I don't know if it would work with midori, but you could try. There are a lot of tutorials on the web for using xdotool, and the man page is very good.
How could you emulate mouse clicks if he wants to use just SSH?

volkscom I ask you: are you running SSH with -X attribute to have the X Server or it's just text SSH ?

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Reload webpage on midori browser through SSH

Wed Jan 29, 2014 9:37 am

He says he is running midori. All that matters is that it is a GUI application, with a desktop it is running in.

I use xdotool almost daily, via ssh. to enter xdotool commands from one machine via ssh, that affect the desktop appearing elsewhere! I am doing it, so I know it can be done, I just don't know the specifics about whether it will work in midori, but when he talks about needing to click on a button, he can study the coordinates or geometry of the webpage, and get the location of that button and use xdotool to enter a double click at that location.

http://tuxradar.com/content/xdotool-script-your-mouse
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

volkscom
Posts: 3
Joined: Tue Jan 28, 2014 11:18 am

Re: Reload webpage on midori browser through SSH

Wed Jan 29, 2014 11:30 am

Angelus88 wrote:
sdjf wrote:There are command line tools that will emulate mouse clicks, you could try making a loop every 15 second that would click that icon. I am using xdotool to emulate mouse clicks, it has a lot of options that mean you can also reposition the mouse pointer on a page. I don't know if it would work with midori, but you could try. There are a lot of tutorials on the web for using xdotool, and the man page is very good.
How could you emulate mouse clicks if he wants to use just SSH?

volkscom I ask you: are you running SSH with -X attribute to have the X Server or it's just text SSH ?
I'm running SSH with -X attribute
Hope you have a solution

Angelus88
Posts: 442
Joined: Mon May 13, 2013 9:25 am
Location: Ivrea, TO (Italy)

Re: Reload webpage on midori browser through SSH

Wed Jan 29, 2014 11:42 am

volkscom wrote:
Angelus88 wrote:
sdjf wrote:There are command line tools that will emulate mouse clicks, you could try making a loop every 15 second that would click that icon. I am using xdotool to emulate mouse clicks, it has a lot of options that mean you can also reposition the mouse pointer on a page. I don't know if it would work with midori, but you could try. There are a lot of tutorials on the web for using xdotool, and the man page is very good.
How could you emulate mouse clicks if he wants to use just SSH?

volkscom I ask you: are you running SSH with -X attribute to have the X Server or it's just text SSH ?
I'm running SSH with -X attribute
Hope you have a solution
Well, if so, you can try to follow what sdjf said ;)

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Reload webpage on midori browser through SSH

Wed Jan 29, 2014 3:17 pm

I cannot write a complete tutorial for this for you, including all the steps you need to take. The first question is, do you know how to write bash scripts? I can think of one possible way to get xdotool to emulate your double click every 15 seconds - one is to have a script running that issues the double click every 15 seconds.

But, do you know how to write scripts?

The second thing is you need to install and write the command that will emulate that click, and test whether it will work in midori. Some applications do not cooperate with xdotool, and the only way to know is to install it and try running it. did you say what operating system you are running? I am not sure whether it is available in your repository.

No sense writing a script unless xdotool works in midori! There is another command that is more basic that also emulates clicks, but I think xdotool is better as it may have more tutorials out there. I don't recall the name of the other command that does the same thing.

if you use apt-get to install stuff, try "apt-get xdotool" to see if it is available precompiled.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Return to “Beginners”