I need help with this script

12 views
Skip to first unread message

TheOne

unread,
Jun 30, 2009, 7:13:25 PM6/30/09
to greasemonkey-users
// ==UserScript==
// @name GaiaOnline Link Rewriter
// @namespace www.nowhere.com/yet
// @include http://www.gaiaonline.com/gaia/vend.php*
// ==/UserScript==
var a=document.getElementsByTagName('a');
for(var i=0;i<a.length;i++)
{
a[i].href=a[i].href.replace(/^http:\/\/www\.gaiaonline\.com\/gaia\/
vend\.php\?mode=buy&(vend_id=\d+)&type=buy&f=confirm&(mystore=\d+$/i,
"http://www.gaiaonline.com/gaia/vend.php?mode=buy&$1&type=buy&f=go&
$2&pass=hardcodedpass");

}


Could someone help me to make it work?

cc

unread,
Jul 1, 2009, 12:28:18 PM7/1/09
to greasemon...@googlegroups.com
Well, your regex is missing a closing group parenthesis after
|(mystore=\d+|. Does that fix it?

If not, perhaps you could explain what's going wrong, exactly.

(I haven't tried testing the resulting script, if you're wondering.)

TheOne

unread,
Jul 1, 2009, 6:38:04 PM7/1/09
to greasemonkey-users
What's supposed to happen is if someone goes to this page:
http://www.gaiaonline.com/marketplac...rch/?sortBy=91
and click the Buy now, it would skip the next page by confirming all
in one click. Bypassing the second page, which on that page a password
is needed to type in and press "Buy Now", which confirms it.

So one click would be needed. I've changed the script to this:

// ==UserScript==
// @name GaiaOnline Link Rewriter
// @namespace www.nowhere.com/yet
// @include http://www.gaiaonline.com/gaia/vend.php*
// ==/UserScript==
var a=document.getElementsByTagName('a');
for(var i=0;i<a.length;i++)
{
a[i].href=a[i].href.replace(/^http:\/\/www\.gaiaonline\.com\/gaia\/
vend\.php\?mode=buy&(vend_id=\d+)&type=buy&f=confirm&(mystore=\d+)$/i,
"http://www.gaiaonline.com/gaia/vend.php?mode=buy&$1&type=buy&f=go&
$2&pass=hardcodedpass");

}

Correcting the grouping that needs to be closed. I wish there would be
some indication of what's going wrong but I'm not getting any response
from this script.
On Jul 1, 11:28 am, cc <CarlCl...@lavabit.com> wrote:
> Well, your regex is missing a closing group parenthesis after
> |(mystore=\d+|. Does that fix it?
>
> If not, perhaps you could explain what's going wrong, exactly.
>
> (I haven't tried testing the resulting script, if you're wondering.)
>
> TheOne wrote:
> > // ==UserScript==
> > // @name GaiaOnline Link Rewriter
> > // @namespacewww.nowhere.com/yet
> > // @includehttp://www.gaiaonline.com/gaia/vend.php*

0160

unread,
Jul 10, 2009, 7:32:39 AM7/10/09
to greasemonkey-users
open the next page to buy now and check sourse. u will see there is a
server side generated [url=http://en.wikipedia.org/wiki/
Cryptographic_nonce]nonce[/url] code (1st time posting so hoping it
accepts bbcode lol) anyhow, without a nonce code included in the
submit u will get errors. its hidden of course and i not sure how to
predict one. 3 numeric values separated by periods. eg
"1247213759.1247213759.58890503" they r not just random numbers. in
this example 1247213759 is a representation of seconds and refreshing
30 seconds later would result in "1247213789", note seconds not
hundredths of a second nor hundredths of a minute but hundreds then
thousands etc of total current sum of seconds which have passed
probably 1970 or 39.548888857 years ago
change one of the other numeric values 1 digit eg 1247213759 to
1247213758
and u get error
General Error
The URL is malformed

wat is interesting is if u try to pen 2 buy now vends super fast u
sometimes get issued the same nonce code which in turn results in a
error msg saying maybe u submitted same twice, or resent post as in
like hitting reload on page after just submitted,



On Jul 1, 6:38 pm, TheOne <Xeno_Fe...@yahoo.com> wrote:
> What's supposed to happen is if someone goes to this page:http://www.gaiaonline.com/marketplac...rch/?sortBy=91
> and click the Buy now, it would skip the next page by confirming all
> in one click. Bypassing the second page, which on that page a password
> is needed to type in and press "Buy Now", which confirms it.
>
> So one click would be needed. I've changed the script to this:
>
> // ==UserScript==
> // @name GaiaOnline Link Rewriter
Reply all
Reply to author
Forward
0 new messages