|
|
#1 |
|
Major Leaguer
Join Date: Mar 2005
Location: Douglasville, GA
Posts: 462
|
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). |
|
|
|
|
|
#2 |
|
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. |
|
|
|
|
|
#3 |
|
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???
|
|
|
|
|
|
#4 |
|
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 |
|
|
|
|
|
#5 | |||||||||||||||||||||||
|
All Star
Join Date: May 2004
Location: london on ca
Posts: 930
|
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>
|
|||||||||||||||||||||||
|
|
|
|
|
#6 |
|
Moderator
Join Date: May 2003
Posts: 4,272
|
Now THAT's what I was talking about. I knew someone would pony up the code.
|
|
|
|
|
|
#7 |
|
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. |
|
|
|
|
|
#8 |
|
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.
|
|
|
|
|
|
#9 | |||||||||||||||||||||||
|
Prospect
Join Date: Sep 2007
Posts: 2
|
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, |
|||||||||||||||||||||||
|
|
|
|
|
#10 |
|
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 |
|
|
|
|
|
#11 | |||||||||||||||||||||||
|
Registered User
Join Date: Mar 2009
Posts: 1
|
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. |
|||||||||||||||||||||||
|
|
|
|
|
#12 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#13 |
|
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. |
|
|
|
|
|
#14 |
|
Prospect
Join Date: Jul 2010
Posts: 3
|
Auto Refresh Solution
Use Opera. It has the feature built in.
|
|
|
|
|
|
#15 |
|
Major Leaguer
Join Date: Jan 2005
Location: Uranium Capital, NM
Posts: 457
|
Or, in Firefox, use the add-on Reloadevery.
__________________
Mac Pro 2x2.66 GHz 10.8.3 MacBook Air 13.3" 10.8.3 |
|
|
|
|
|
#16 |
|
Prospect
Join Date: Jul 2010
Posts: 3
|
Reloadevery seems broken in OSX Firefox 3.6.8
Installed it on two different Macs without success.
|
|
|
|
|
|
#17 |
|
Hall of Famer
Join Date: Dec 2007
Posts: 3,641
|
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')
|
|
|
|
|
|
#18 | |||||||||||||||||||||||
|
Prospect
Join Date: Sep 2009
Posts: 2
|
Absolutely brilliant. Works perfectly; many thanks!!!
|
|||||||||||||||||||||||
|
|
|
|
|
#19 |
|
Hall of Famer
Join Date: Dec 2007
Posts: 3,641
|
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.
|
|
|
|
|
|
#20 |
|
Prospect
Join Date: Mar 2006
Posts: 2
|
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. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|