Homestar Runner Wiki Forum

A companion to the Homestar Runner Wiki
It is currently Thu Jul 31, 2025 6:30 am

All times are UTC




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Script help needed, Greasemonkey or otherwise
PostPosted: Tue Mar 11, 2008 9:57 pm 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
Heyo coders, I've got a request or at least a point in the right direction.

I'm looking for a little script for myself that all it would do would open a specific url at regular intervals on the factor of 30 seconds or so. It would run in firefox, and could do it either in one url or open a new tab with that url.

If anyone is able to throw this together for greasemonkey or some other way this can be implemented that would be amazing.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Tue Mar 11, 2008 11:29 pm 
Offline
User avatar

Joined: Mon Jan 17, 2005 1:00 am
Posts: 3849
Location: Best Coast
So like, something that just refreshes a page over and over?

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Tue Mar 11, 2008 11:37 pm 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
Basically, yeah. Only the catch is that the url I want to refresh is the uroulette's random webpage link (http://www.uroulette.com/visit), which once you plug it in it redirects your browser to another page. It doesn't *sound* like it's that difficult to code up, but then again I know nothing about greasemonkey or general script making >.>

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Tue Mar 11, 2008 11:46 pm 
Offline
User avatar

Joined: Wed Aug 15, 2007 8:39 am
Posts: 2994
Location: Drinkin' orange juice out of a champagne glass.
I'm pretty sure there's a Firefox plug-in that does this.

EDIT:
https://addons.mozilla.org/en-US/firefox/addon/115

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 12:00 am 
Offline
User avatar

Joined: Sun Mar 20, 2005 1:09 am
Posts: 8987
Location: He remembered Socks!
Capt. Ido Nos wrote:
Basically, yeah. Only the catch is that the url I want to refresh is the uroulette's random webpage link (http://www.uroulette.com/visit), which once you plug it in it redirects your browser to another page. It doesn't *sound* like it's that difficult to code up, but then again I know nothing about greasemonkey or general script making >.>

So you wanna earn good DP in Pmog too, huh?

_________________
ImageImage


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 12:06 am 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
Oh man, that's SO close ^^;; I downloaded it anyway because it looks helpful for other things, buuuut I want something that reloads a specific url, in this case http://www.uroulette.com/visit as opposed to the present site the page is on. Thanks for the pointer though, iand.

And yes Cola, I do :p I'll be sure to share this if anyone comes through, or if I stumble on a solution.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 12:59 am 
Offline
Pizza Pizza
User avatar

Joined: Tue Jun 22, 2004 4:05 pm
Posts: 10451
Location: probably the penalty box
http://blog.monstuff.com/archives/000239.html

Try the "auto reload" script (second link listed)

Code:
// Auto Reload
// version 0.1
// 2005-04-06
// Copyright (c) 2005, Julien Couvreur
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// You should configure the Included and Excluded pages in the GreaseMonkey
//      configuration pane.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "Auto Reload", and click Uninstall.
//
// --------------------------------------------------------------------
//
// WHAT IT DOES:
//  Reload the pages configured in the Included page list every minute.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name            Auto Reload
// @namespace       http://blog.monstuff.com/archives/cat_greasemonkey.html
// @description     "Included pages" will get reloaded every minute.
// @include         http://put.your.own.pages/*/here
// ==/UserScript==


setTimeout(function() { document.location.reload(); } , 60000);



Set the 60000 to whatever time you want (in milliseconds).
Say you want 20 seconds between reloads, change the 60000 to 20000.

_________________
If you can't fix it with a hammer, you have an electrical problem.


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 1:05 am 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
Okay, sweet! I've got it all installed and I believe it's turned on correctly? I went into the Manage User Scripts and entered http://www.uroulette.com/visit into the refresh urls, now how do I get it to actually work?

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 1:43 am 
Offline
Pizza Pizza
User avatar

Joined: Tue Jun 22, 2004 4:05 pm
Posts: 10451
Location: probably the penalty box
I have no clue. I think you have to go to that page.
The problem is, that page does some sort of re-direct, and I think the script only works if you stay on that page.
Short answer, I don't actually know.

_________________
If you can't fix it with a hammer, you have an electrical problem.


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 1:59 am 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
Yeah, I was running into the same problem. Eh, I'll see if I can work it out? I don't know greasemonkey, buuuuut who knows?

Any better solution is still appreciated.

The project restated: a firefox script/extension that takes you to a specific url at regular intervals.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Wed Mar 12, 2008 2:17 am 
Offline
User avatar

Joined: Sun Mar 20, 2005 1:09 am
Posts: 8987
Location: He remembered Socks!
Capt. Ido Nos wrote:
Yeah, I was running into the same problem. Eh, I'll see if I can work it out? I don't know greasemonkey, buuuuut who knows?

Any better solution is still appreciated.

The project restated: a firefox script/extension that takes you to a specific url at regular intervals.

Find a Firefox Runescape Auto-Clicker and download the stumble upon toolbar, and just set the thing to click the stumble button every 20-30 seconds, and let it sit while you sleep or go outside and live.

Pretty much, what you want is to edit a reloader greasemonkey script , but make it target a specific URL.

Should be simple.

_________________
ImageImage


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 12:12 am 
Offline
User avatar

Joined: Mon Jan 17, 2005 1:00 am
Posts: 3849
Location: Best Coast
So, is the page that it runs on also an HTML page? If so, you can try something like this:
Code:
// ==UserScript==
// @name          that thing
// @namespace     http://forum.hrwiki.org/
// @description   reloads some page
// @include       http://something.com/*
//                   ^ (put the URL you want it to run from right there)
// ==/UserScript==

var interval = 30;  // seconds until refresh
var url = 'http://something.com/orange.html';  // the page you want it to go to

var elements = document.getElementsByTagName('*');  // if this line doesn't work, try 'html' or 'head' or something

var scriptText = '<script type="text/javascript"> setTimeout(\'window.location="' + url + '";\', ' + (interval*1000) + '); </script>';  // this puts together some javascript to insert into the page that will redirect, based on the two variables at the top
elements[0].innerHTML = elements[0].innerHTML + scriptText;

I'm too lazy to test it right now, but if it doesn't work just tell me and I'll try to fix it.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 1:12 am 
Offline
User avatar

Joined: Sun Mar 20, 2005 1:09 am
Posts: 8987
Location: He remembered Socks!
ed 'lim' smilde wrote:
So, is the page that it runs on also an HTML page? If so, you can try something like this:
Code:
// ==UserScript==
// @name          that thing
// @namespace     http://forum.hrwiki.org/
// @description   reloads some page
// @include       http://something.com/*
//                   ^ (put the URL you want it to run from right there)
// ==/UserScript==

var interval = 30;  // seconds until refresh
var url = 'http://something.com/orange.html';  // the page you want it to go to

var elements = document.getElementsByTagName('*');  // if this line doesn't work, try 'html' or 'head' or something

var scriptText = '<script type="text/javascript"> setTimeout(\'window.location="' + url + '";\', ' + (interval*1000) + '); </script>';  // this puts together some javascript to insert into the page that will redirect, based on the two variables at the top
elements[0].innerHTML = elements[0].innerHTML + scriptText;

I'm too lazy to test it right now, but if it doesn't work just tell me and I'll try to fix it.
Nope doesn't work. What it should do is load a certain page in one tab every 30 seconds. Since the website you enter just directs you to some random webpage, the script can't reload the page because the URL changes to something else.

_________________
ImageImage


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 4:26 am 
Offline
User avatar

Joined: Tue Dec 12, 2006 8:18 pm
Posts: 2150
Location: Somewhere over the rainbow...
Ever thought of trying the iMacros add-on for Firefox?

https://addons.mozilla.org/en-US/firefox/addon/3863

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 5:32 am 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
MooKoo wrote:
Ever thought of trying the iMacros add-on for Firefox?

https://addons.mozilla.org/en-US/firefox/addon/3863

You know what? This one seems the most promising. Already I've made a simple macro that takes me there, and now I've just got to figure out how to make it loop for as long as it's turned on...

I'm going to give the simple looper they give you a shot and see what's become of my lappy when I wake up tomorrow.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 2:28 pm 
Offline
User avatar

Joined: Tue Dec 12, 2006 8:18 pm
Posts: 2150
Location: Somewhere over the rainbow...
Capt. Ido Nos wrote:
MooKoo wrote:
Ever thought of trying the iMacros add-on for Firefox?

https://addons.mozilla.org/en-US/firefox/addon/3863

You know what? This one seems the most promising. Already I've made a simple macro that takes me there, and now I've just got to figure out how to make it loop for as long as it's turned on...

I'm going to give the simple looper they give you a shot and see what's become of my lappy when I wake up tomorrow.

Your welcomes. That is if it works completely.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 3:20 pm 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
It's sort of working. I looked through their demos and sample code and couldn't quite get a single continually running macro, but I did learn at least how to make the browser go to a specific url, and then loop that a couple hundred times.

There are a few problems, but I'm not leaning towards the fact that it's my own problems, but instead the websites that I visit. The pages every once in a while clock out, and that makes the loop quit, but that's cool, I can just go and start it up again.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Thu Mar 13, 2008 11:45 pm 
Offline
Pizza Pizza
User avatar

Joined: Tue Jun 22, 2004 4:05 pm
Posts: 10451
Location: probably the penalty box
Capt. Ido Nos wrote:
It's sort of working. I looked through their demos and sample code and couldn't quite get a single continually running macro, but I did learn at least how to make the browser go to a specific url, and then loop that a couple hundred times.

There are a few problems, but I'm not leaning towards the fact that it's my own problems, but instead the websites that I visit. The pages every once in a while clock out, and that makes the loop quit, but that's cool, I can just go and start it up again.

You might want to put in some error-checking to keep a timed out page from kicking your code.
Could I see your code?

_________________
If you can't fix it with a hammer, you have an electrical problem.


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Fri Mar 14, 2008 12:28 am 
Offline
User avatar

Joined: Sun Mar 20, 2005 1:09 am
Posts: 8987
Location: He remembered Socks!
I wonder if a BASIC program would work...

Code:
10 load url http://uroulette.com/visit
20 pause 30000 ms
30 go to 10

_________________
ImageImage


Top
 Profile  
 
 Post subject: Re: Script help needed, Greasemonkey or otherwise
PostPosted: Fri Mar 14, 2008 3:27 pm 
Offline
User avatar

Joined: Mon Feb 20, 2006 6:45 pm
Posts: 5441
Location: living in the sunling, loving in the moonlight, having a wonderful time.
StrongRad wrote:
You might want to put in some error-checking to keep a timed out page from kicking your code.
Could I see your code?


Yeah sure. It's not that much, but here you go:
Code:
VERSION BUILD=6030228 RECORDER=FX
TAB T=1
URL GOTO=http://www.uroulette.com/visit
WAIT SECONDS=1


Then in the play menu I go down to the loop options, make it go from somewhere like 1 to 100, and hit play loop. Because of the timeout issue, it usually doesn't reach 100. Once it got as far as the 80s before quitting out, so I'm certain that it's the clockout error that's the problem.

This runs off of the iMacros extension that Mookoo linked to earlier.

Some sort of error check would be wonderful, plus perhaps a way to have it loop itself instead of the menu way of looping. I don't know much about their language, so this is all new to me, their way of doing things.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group