Go Back   The macosxhints Forums > OS X Help Requests > Applications



Reply
 
Thread Tools Rating: Thread Rating: 95 votes, 5.00 average. Display Modes
Old 06-24-2005, 03:31 PM   #1
Reflect_TRUTH
Major Leaguer
 
Join Date: Mar 2005
Location: Douglasville, GA
Posts: 462
Question Auto Refresh Safari pages?

Is there a way to have a Safari webpage refresh automatically every minute to every couple minutes? I have a page that updates very frequently that I need info from.

Im not really familiar with RSS but does it do something like that? I seriously doubt this site does not have a feed (if thats what it needs).
Reflect_TRUTH is offline   Reply With Quote
Old 06-24-2005, 05:36 PM   #2
giskard22
Moderator
 
Join Date: May 2003
Posts: 4,272
If RSS is an option, that would be excellent. Safari won't check an RSS feed more often than every 30 minutes, but other RSS readers will let you set pretty much whatever you want.

If RSS isn't an option, you could maybe do this using JavaScript. Keeping in mind I'm not a web coder at all, you could make an html file on your local hard drive with two frames: the first frame just has a JavaScript timer loop that tells the 2nd frame to load a URL every so often.
giskard22 is offline   Reply With Quote
Old 06-24-2005, 09:29 PM   #3
Reflect_TRUTH
Major Leaguer
 
Join Date: Mar 2005
Location: Douglasville, GA
Posts: 462
I really have NO clue when it comes to Javascript. I've never had to mess with it before. I dont suppose there is another way to do it???
Reflect_TRUTH is offline   Reply With Quote
Old 06-25-2005, 02:16 AM   #4
mark hunte
MVP
 
Join Date: Apr 2004
Location: Hello London Calling
Posts: 1,787
Theres a hint here on changing Safari Rss update times

http://www.macosxhints.com/article.p...ery=safari+rss


or you could try a Applescript like below saved as a Application Bundle (stay open) ticked.
The time is set for two minutes (120) and you need to change the url.

Code:
on idle
	
	tell application "Safari"
		activate
		set URL of front document to "http://forums.macosxhints.com/search.php?do=getnew"
	end tell
	
	
	return 120
	
	
end idle
mark hunte is offline   Reply With Quote
Old 06-25-2005, 11:15 AM   #5
biovizier
All Star
 
Join Date: May 2004
Location: london on ca
Posts: 930
Quote:
Originally Posted by Reflect_TRUTH
I really have NO clue when it comes to Javascript. I've never had to mess with it before. I dont suppose there is another way to do it???

You don't need javascript - html should do. Try something along these lines:
Code:
<html>
<head>
      <meta ***********="refresh" content="60">
</head>
<body>
<FRAMESET>
      <FRAME src="http://www.macosxhints.com">
</FRAMESET>
</body>
</html>
Change the "60" to the desired interval in seconds, and substitute your url of interest, then save it as plain text with a ".html" extension. Once the file opened in your browser, it should reload itself after the specified interval, and since the frame displays the outside site, it should end up being reloaded as a result, although that might be affected by cache settings.
biovizier is offline   Reply With Quote
Old 06-25-2005, 01:12 PM   #6
giskard22
Moderator
 
Join Date: May 2003
Posts: 4,272
Now THAT's what I was talking about. I knew someone would pony up the code.
giskard22 is offline   Reply With Quote
Old 08-18-2005, 06:08 AM   #7
Reflect_TRUTH
Major Leaguer
 
Join Date: Mar 2005
Location: Douglasville, GA
Posts: 462
I have been away for a while and never got to say thank you for this one. Well done.

Forgive my ignorance once again, but what app should I be using to input this HTML string?

I'm afraid Im simple minded and have to be instructed like a 3 year old

Last edited by Reflect_TRUTH; 08-18-2005 at 06:13 AM.
Reflect_TRUTH is offline   Reply With Quote
Old 09-05-2005, 04:18 PM   #8
ThreeDee
Hall of Famer
 
Join Date: Aug 2005
Location: USA
Posts: 3,418
You can just use TextEdit, and cnange "http;//www.macosxhints.com" to something else. Or you can use Nvu. http://www.nvu.com Its a WYSIWYG editor based on Mozilla's editor.
ThreeDee is offline   Reply With Quote
Old 09-24-2007, 11:05 AM   #9
iambrother
Prospect
 
Join Date: Sep 2007
Posts: 2
Quote:
Originally Posted by biovizier
You don't need javascript - html should do. Try something along these lines:
Code:
<html>
<head>
      <meta ***********="refresh" content="60">
</head>
<body>
<FRAMESET>
      <FRAME src="http://www.macosxhints.com">
</FRAMESET>
</body>
</html>
Change the "60" to the desired interval in seconds, and substitute your url of interest, then save it as plain text with a ".html" extension. Once the file opened in your browser, it should reload itself after the specified interval, and since the frame displays the outside site, it should end up being reloaded as a result, although that might be affected by cache settings.

Hey, I tried this and it worked, well sort of. I had 2 issues with it, that I was looking for some guidance on. First, each time the page refreshed it returned to the top of the page, when on this website the new data is located on the bottom of page and would require me to scroll. Is there a way for it to refresh to the bottom of the page until the top of the page? Also, is there a way for the script to refresh UNTIL new data appears and then stop refreshing? Finally, when I had it set on "1" for seconds, the page continued to refresh the OLD data even after someone else told me that the page had already been refreshed with NEW data, any explanations?

Thanks,
iambrother is offline   Reply With Quote
Old 07-23-2008, 07:19 PM   #10
jman995x
Prospect
 
Join Date: Sep 2007
Posts: 5
Hello,

I too was looking for just this solution.
However, I must be studying too hard because I cut-n-pasted the text in this post into TextEdit, saved it as HTML, then went to my Documents folder and clicked on the file, only to have it open a new Safari window with the HTML coding in it....not the page I wanted....just the HTML coding you see in the aforementioned posts.

What am I missing?

Thanks,

Justin
jman995x is offline   Reply With Quote
Old 03-13-2009, 06:16 PM   #11
bensaffer
Registered User
 
Join Date: Mar 2009
Posts: 1
Quote:
Originally Posted by iambrother
Hey, I tried this and it worked, well sort of. I had 2 issues with it, that I was looking for some guidance on. First, each time the page refreshed it returned to the top of the page, when on this website the new data is located on the bottom of page and would require me to scroll. Is there a way for it to refresh to the bottom of the page until the top of the page? Also, is there a way for the script to refresh UNTIL new data appears and then stop refreshing? Finally, when I had it set on "1" for seconds, the page continued to refresh the OLD data even after someone else told me that the page had already been refreshed with NEW data, any explanations?

Thanks,

Have a look at the source for the website you want to refresh - you should be able to use the "divs".

E.g. If the section you want to refresh to is called "Portfolio" on web site www.example.com

Link to www.example.com/#Portfolio

That should work.

Reloading old data is cos of your cache, have a play with settings (Presume you're in Safari where Cache-ing probs are common) and reload less often than every second as that will cause you problems too. 10 secs min I'd recommend.
bensaffer is offline   Reply With Quote
Old 01-12-2010, 06:13 PM   #12
bart
Guest
 
Posts: n/a
10.1

The frame thing works ok, if you have little more code expertice you can do AJAX / jQuery refresh.

But the idea of this post is to show how to get a non cached page everytime.

You can try using Javascript to add random value.
example: http://www.google.com/?rnd=(random number) will not be cached as far as the random number is different.

another way is to use pragma cache=no-cache on your html.

and, another way to create something more appealing is to use FLASH or JAVASCRIPT to load the webpage webpage.load("http://www.something.com" + Math.rnd() * 9999)
and the parse the data on a function like :

webpage.onData = function(data) {
// parse the data to get the elements you need.
// but this involve more development.
}

Google is your friend.!
Greetings,
Bart.
  Reply With Quote
Old 07-29-2010, 12:10 PM   #13
aokoch
Prospect
 
Join Date: Jul 2010
Posts: 3
HTML reload not working

In Safari 5.0, the file loads the "target" page but does not refresh (as if the framset is ignored).

In Firefox 3.6.8, odd characters display (I assume related to the meta tag).

Any ideas, anyone?

Thanks.
aokoch is offline   Reply With Quote
Old 08-02-2010, 10:52 AM   #14
aokoch
Prospect
 
Join Date: Jul 2010
Posts: 3
Auto Refresh Solution

Use Opera. It has the feature built in.
aokoch is offline   Reply With Quote
Old 08-03-2010, 03:22 PM   #15
tommaso
Major Leaguer
 
Join Date: Jan 2005
Location: Uranium Capital, NM
Posts: 475
Or, in Firefox, use the add-on Reloadevery.
__________________
Mac Pro 2x2.66 GHz 10.9.4
MacBook Pro 13.3" 10.9.4
tommaso is offline   Reply With Quote
Old 08-03-2010, 03:51 PM   #16
aokoch
Prospect
 
Join Date: Jul 2010
Posts: 3
Reloadevery seems broken in OSX Firefox 3.6.8

Installed it on two different Macs without success.
aokoch is offline   Reply With Quote
Old 08-03-2010, 04:08 PM   #17
NaOH
Hall of Famer
 
Join Date: Dec 2007
Posts: 3,805
You can save the following JavaScript as a bookmark I prefer to store in the Bookmark Bar, but it's your choice then select this bookmark while viewing the page to be refreshed. It will confirm the page and allow you to set the refresh delay in seconds.

Code:
javascript:(function(p){open('','',p).document.write('%3Cbody%20id=1%3E%3Cnobr%20id=2%3E%3C/nobr%3E%3Chr%3E%3Cnobr%20id=3%3E%3C/nobr%3E%3Chr%3E%3Ca%20href=%22#%22onclick=%22return!(c=t)%22%3EForce%3C/a%3E%3Cscript%3Efunction%20i(n){return%20d.getElementById(n)}function%20z(){c+=0.2;if(c%3E=t){c=0;e.location=u;r++}x()}function%20x(){s=t-Math.floor(c);m=Math.floor(s/60);s-=m*60;i(1).style.backgroundColor=(r==0||c/t%3E2/3?%22fcc%22:c/t%3C1/3?%22cfc%22:%22ffc%22);i(2).innerHTML=%22Reloads:%20%22+r;i(3).innerHTML=%22Time:%20%22+m+%22:%22+(s%3C10?%220%22+s:s)}c=r=0;d=document;e=opener.top;u=prompt(%22URL%22,e.location.href);t=u?prompt(%22Seconds%22,60):0;setInterval(%22z()%22,200);if(!t){window.close()}%3C/script%3E%3C/body%3E')})('status=0,scrollbars=0,width=100,height=115,left=1,top=1')
Someone somewhere deserves credit for that code, but I no longer know who.
NaOH is offline   Reply With Quote
Old 08-19-2010, 11:07 AM   #18
MacHead67
Prospect
 
Join Date: Sep 2009
Posts: 2
Absolutely brilliant. Works perfectly; many thanks!!!

Quote:
Originally Posted by NaOH
You can save the following JavaScript as a bookmark I prefer to store in the Bookmark Bar, but it's your choice then select this bookmark while viewing the page to be refreshed. It will confirm the page and allow you to set the refresh delay in seconds.

Code:
javascript:(function(p){open('','',p).document.write('%3Cbody%20id=1%3E%3Cnobr%20id=2%3E%3C/nobr%3E%3Chr%3E%3Cnobr%20id=3%3E%3C/nobr%3E%3Chr%3E%3Ca%20href=%22#%22onclick=%22return!(c=t)%22%3EForce%3C/a%3E%3Cscript%3Efunction%20i(n){return%20d.getElementById(n)}function%20z(){c+=0.2;if(c%3E=t){c=0;e.location=u;r++}x()}function%20x(){s=t-Math.floor(c);m=Math.floor(s/60);s-=m*60;i(1).style.backgroundColor=(r==0||c/t%3E2/3?%22fcc%22:c/t%3C1/3?%22cfc%22:%22ffc%22);i(2).innerHTML=%22Reloads:%20%22+r;i(3).innerHTML=%22Time:%20%22+m+%22:%22+(s%3C10?%220%22+s:s)}c=r=0;d=document;e=opener.top;u=prompt(%22URL%22,e.location.href);t=u?prompt(%22Seconds%22,60):0;setInterval(%22z()%22,200);if(!t){window.close()}%3C/script%3E%3C/body%3E')})('status=0,scrollbars=0,width=100,height=115,left=1,top=1')
Someone somewhere deserves credit for that code, but I no longer know who.

MacHead67 is offline   Reply With Quote
Old 08-19-2010, 12:06 PM   #19
NaOH
Hall of Famer
 
Join Date: Dec 2007
Posts: 3,805
No credit to me. I'm just sharing what I've found. If you do a web search for JavaScript Bookmarklets you may find other bits of JavaScript code you find useful.
NaOH is offline   Reply With Quote
Old 06-28-2011, 12:52 PM   #20
rwelti
Prospect
 
Join Date: Mar 2006
Posts: 2
Thumbs up Just the ticket

THANK YOU

I wanted this very thing, too.

Useful if you are online say banking or some other thing, and you don't want to be kicked off. Obviously use with caution.
rwelti is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:20 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.