Firfox Page Refresher

Subscribe to Firfox Page Refresher 15 posts, 5 voices

 
Tom O'C User

I've used the "Facebook Page Refresher" script, and love it. But it only does the home page. I tried to create my own script but failed. What I want:

A script that refreshes ALL pages at a 30 second (or so) interval. That way, my inbox, message board topics, facebook and myspace pages can all be refreshed. Hopefully this is possible. I thought it might be as simple as using a "*.*.com/* command or something. I was wrong :P

 
Descriptor Scriptwright

It's probably even more simple than you think:
location.reload(true)
reference: http://developer.mozilla.org/en/docs/DOM:window...
You need a timer, so...

timeoutID = setTimeout(function(){location.reload(true)}, 30000);

Make sure you put any domains you want this to work on in the @include, don't use @include *.
And I personally would make it at least 60000 (60 seconds), I mean what are you gonna miss that you can't wait a minute, don't "pound" the server. I had clients that would check for mail every 5 minutes and get only a couple a day, I hated that when I had to sift through all those server logs.

 
Descriptor Scriptwright

Come to think of it, this might work better - it depends on the site I think...

timeoutID = setTimeout(function(){location.reload(false)}, 30000);
reload(forceget): If forceget is false or not specified, the browser may reload the page from its cache.

however false is better if it works because the page will load faster.

 
Joel H Scriptwright

@Descriptor, I think you're over-thinking it. It seems to me that he already has a script to refresh the home page every n seconds, leading me to conclude...

@Tom right click on the monkey icon (or the tools menu, if you prefer) and hit 'manage user scripts'. Select the facebook refresher, and change the include from "http://facebook.com" to "http://facebook.com/*" and that should work. Post back if it doesn't.

-Joel

 
Descriptor Scriptwright

I'm only over-thinking it because I'm not familiar with Facebook, and most importantly haven't seen the "Facebook Page Refresher" script (I even searched for it).
How can I out-think something when I can't even see if it will work on myspace? Otherwise I probably wouldn't have said anything, because I'm ignorant.

 
Joel H Scriptwright

I'm not that familiar with Facebook either, but he had specified the home page, and that he wanted all other pages to refresh, too. Not that I'm familiar with myspace either (in fact I avoid it explicitly) but I presume that it's similar to a script refreshing just your home page instead of all myspace pages, such as those of your friends. Either way, the modification to the existing script should be pretty simple.

-Joel

 
Tom O'C User

Thanks so much guys, I'll first try editing the facebook script, then try out the new script so I can utilize it for all other webpages. You were both a big help, thanks

 
Tom O'C User

I changed the script to include http://www.facebook.com/* like you said. Nothing changed, it still only refreshed the homepage. Any other thoughts. I'm not good with Java, only HTML...so writing my script isn't going well. I'm doing my best to learn though

 
Descriptor Scriptwright

Well, either make a new script for those sites, adding them to the include as Joel mentioned, using either of the lines of code I posted; or give us a link to the "Facebook Page Refresher" script so we can see what it does.
It would be easier to just make a new script. I tried the code I posted and it should work on any site, the first one will reload everything including all the images, the second one "should" only reload the page and/or images if they have been modified since the last reload (however servers can lie about that), but "should" work the same as hitting the reload button.

 
Joel H Scriptwright

After logging in quickly, it looks like you'll have to do some investigating; the include should look like:
http://xxx.facebook.com/*
where the xxx is whatever shows up in the url after you've logged in. Note that this will only work for other people in your network, eg. if it's a school, then only other people at that school. You have two options to get around this; either add more includes for each school, or use another wild card, such as
http://*facebook.com/*
Most people don't recommend the additional wild card there, because it can match a site like:
http://spam.malware.com/evil/facebook.com/bad.html
which, as you may have guessed based on word choice, is not a good thing.

-Joel

 
Descriptor Scriptwright

I think this will work - complete script...

// ==UserScript==
// @name           Page_Refresher
// @namespace      http://userscripts.org/users/30614
// @description    Reloads facebook.com and myspace.com every 60 seconds
// @include        http://*.facebook.com/*
// @include        http://*.myspace.com/*
// ==/UserScript==

// Add more domains to @include and this list
var domains = ["facebook.com","myspace.com"];
// Reload time in seconds
var reload = 60;

function checkDomainNames(){
  var domainname = location.hostname.match(/\b\w[-\w]+\.\w{2,3}$/);
  for(var i = 0; i < domains.length; i++){
    if(domains[i] == domainname) return true;
  }
  return false;
}

if(checkDomainNames()){
  reload = reload * 1000;
  setTimeout(function(){location.reload(false)}, reload);
}

 
sizzlemctwizzle Scriptwright

can't you do this with meta data, and also wouldn't it be better to only upload part of a page?

 
sizzlemctwizzle Scriptwright

I finished a script for facebook that reloads parts of the page every 60 seconds. http://userscripts.org/scripts/show/10682

 
InsaneNinja Scriptwright

you should really check my script if you want something like this for myspace...

http://userscripts.org/scripts/show/6365

it uses ajax calls and updates your homepage every 20 seconds, without refreshing

 
sizzlemctwizzle Scriptwright

Dude I have that script for myspace. It kicks ass. My script now updates the Facebook homepage every 30 seconds and a whole bunch of other shit without a page refresh.