eBay Snipe Script

Subscribe to eBay Snipe Script 9 posts, 3 voices

Keith Hopkins Scriptwright

Hello,

I am trying to improve my snipe script but my java SUX!

I don't know if it possible I am trying to get a cookie for http://www.esteal.com so I can have my username and pass in the script to save me entering it?

Here is my modified code if you want to have a look

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//eSteal Variables
//Snipe seconds before end
var delta = 10;
//Default bid for the item
var maxbid = .99;

// Find the data QQitemZ in URL and counts the number of characters before the url after http://search.ebay.co.uk
// i.e  /Driving-Test-Success-All-Tests-New-2006-2007-Edition_W0 = 56
var idLoc = location.pathname.indexOf("QQitemZ");

// Define Varabiles
// itemId the variable holding the string for the item number
// endLoc the variable holding the end of string count
var itemId, endLoc;

if (idLoc != -1) {
	idLoc += 7;
	endLoc = location.pathname.indexOf( "QQ", idLoc );
	itemId = location.pathname.substring( idLoc, endLoc );
} else {
	idLoc = location.search.indexOf("&item=");
	if ( idLoc != -1 ) {
		idLoc += 6;
		var endLoc = location.search.indexOf( "&", idLoc );
		if ( endLoc <= idLoc ) {
			endLoc = location.search.length;
		}
		itemId = location.search.substring( idLoc, endLoc );
	}
}


if (idLoc != -1) {
	var snipeUrl = "http://www.esteal.com/signup/snipper.php?action=bang&itemno=" + itemId + "&maxbid=" + maxbid + "&delta=" + delta + "&qnt=1&folder=0&submit=bang"

// Finds the url ref "ShowEmailAuctionToFriend" Link adds snipe info

	var watchLink = 0;
	for ( var i = 0; i < document.links.length; i++ ) {
		if ( document.links.item(i).href.indexOf( "ShowEmailAuctionToFriend" ) != -1 ) {
			watchLink = document.links.item(i);
			break;
		}
	}

	if (watchLink) {
		var snipeLink = document.createElement("a");
		snipeLink.href = snipeUrl;
		snipeLink.title = "Snipe this auction";
		var img = document.createElement("img");
		img.src = "data:image/gif,GIF89a%10%00%10%00%E6%7F%00%8C%16%16%C6%C6%C6%5C%08%08%1B%14%0B~RR%08%0C%06%04W%18%60ZZ%0A%3D%16hni%20%2B%23%0B%15%0A%06Z%1B%0E4%17%0EC%1B%06E%12%05X%19%00f%19%00%B2-%07%5B%1CPUQ%00%BA%2F%F8%F8%F8%FF%FF%FF%E9%E9%E9%00%7F%20%00%BF0%00%8C%23%DA%DA%DA%24%24%20%D9%D9%D9%DF%A9%A9Z%20%20.6-I%3F%3BpVV%0A%25%11%C2SS%C5RR%19%20%17%BCWW%00r%1D%A0%A0%A0%D6%A6%A6poo%5CYT.%3B1%E2%E2%E2%D3FF%C2%C2%C2Q'%22%B5NNB%0E%0E%B0%90%90%FD%FD%FD%F0%F0%F0%F4%F4%F4JNJ0%3C3SHHN%3D6zxx'%1B%12%AC%AC%AC%F3%9D%9D%91RR%056%0F%107%19%80ll%FC%7F%7F%E7%AE%AE%EB%A0%A0%93%93%93%C8%86%86%D5%92%92%B9%A9%A9%CFrr%CA%2B%2BU%5BW%E3cc%3D%22%22%C3%60%60%ED%8C%8C%E7%83%83%02U%16%F7vv%8D((%85%3B%3B%7F%25%25%0CO%1Du99%BD%BD%BD%09%3A%13%12%1B%14%FCllr%11%11%C0%7C%7C%00%99%26%C5ll%F9%C5%C5X%2F%2F%DB%AE%AE%D3%D3%D3%D7%D7%D7%CB%AC%AC%0F6%18*%0F%0B%FDcc%3C%1A%1A%F3%F3%F3AJC%BDppJJFdie%F7%F6%F6%F2%B1%B1%26%20%195%22%1BuTT%84%84%84%04Z%1AZYY%0E%3D%17%00%A6)%00%C72%00%00%00%00%CC3%FF%FF%FF!%F9%04%01%00%00%7F%00%2C%00%00%00%00%10%00%10%00%00%07%EB%80%7F%826rcEk%5E(%04%3D%3F%17%82%82%16sU%40e%3C%05%0D%11%11z%5D%18%828GRF-%7D%19%1A~%A7~%11%2C%17m%1FS%2Bq%0E%7C~%7B%0DC%A7%10%047%1COJ%14%13%B3%10'%14Y~%7C%0BQhKOD%B2~%10!p%08%7C%7C%0E9IL%60o%7D%15%B4%0A%0A%C0%15%08%225b0Q2%06%A7%06i%7B%7C%0C%7DW%26%25VM3%03%7B%A8%7B%13%7D%09f%01%5B%DCp%A9%13%A4%0F*%12%0A%EE%BC%10%84A%01%83%0D%3E%0E%18%F4%13%C6%C5%81%11v%F2%24(%B0GB%01-*%26%FA!%D1%01%0A%9D%3E%C0%3Cb%D9%F1bA%3Ec)%22d8%85%A7%00%002%1E%FE%F4x%80%0A%95%04!%03%00%80%08%F0H%07%15S~6%3C(%40%E3%0B%9B%18%8F%FEXpR%A0O%1F5%02%04%A8Ar%E6Q%20%00%3B";
		img.border = "0";
		img.align = "top";
		snipeLink.appendChild(img);
		watchLink.parentNode.insertBefore(snipeLink, watchLink);
		watchLink.parentNode.insertBefore(document.createTextNode(" "), watchLink);
		snipeLink = document.createElement("a");
		snipeLink.href = snipeUrl;
		snipeLink.title = "Snipe this auction";
		snipeLink.target = "_esteal"
		snipeLink.appendChild(document.createTextNode("Snipe this Item"));
		watchLink.parentNode.insertBefore(snipeLink, watchLink);
		watchLink.parentNode.insertBefore(document.createTextNode("  |  "), watchLink);
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If any one could give me any ideas as i'm stuck :(

Thanks,
Keith

 
Adrian Scriptwright

You can't get cookies for a different site than the one the script is running on. But even so, wouldn't it be a really bad thing to have your password stored in a plaintext cookie? You may as well just write them into your script...

P.S. you should surround code in <pre> tags to prevent all those formatting problems

 
Keith Hopkins Scriptwright

Thanks for you reply,

I have posted the script http://userscripts.org/scripts/show/8780

 
Adrian Scriptwright

One thing you could do is include the esteal.com page in your script and perform a check for it near the top which would automatically log you in if you're not already. How to store the username/password, on the other hand, is a different matter altogether. But at least you can read the cookies since the script is working on esteal.com.

Also, you should change your ebay include line.

// @include       http://cgi.ebay.*

to
// @include       http://cgi.ebay.tld/*

This prevents the script from being run on potentially malicious sites such as http://cgi.ebay.h4x0r.stealzurpws.info/.
The tld is a shorthand to mean any top-level domain, such as .com, .net, or .co.uk.

 
Keith Hopkins Scriptwright

Thanks,

I have changed the

// @include       http://cgi.ebay.tld/*

Is there anyway to read the cookie then rewrite the cookie and change the 'at end of session'?

I don't like the idea of having the password in plain text. As I understand it would be impossible to encrypt the data..

 
Joel H Scriptwright

If you prefer, you could use the prompt() function to get the user name and password; you're still inputing them, so it's more secure, but you're not actually going to that site per se.

-Joel

 
Keith Hopkins Scriptwright

Hello again,

I have managed to get the sessionid for the cookie I have 1 thing to sort and im all done : )

I have to add 1 day to the cookie so it doesn't expire after it is created?

I have tried var date = DateAdd('d',1,Now()) but it didn't work?

//Current date and time
var date = date now()

// finds the start of the session code
var offset = document.cookie.indexOf("=")+1

//length of cookie
var end = document.cookie.length

//build sessionid
var sessionid = document.cookie.substring(offset, end)

//new cookie
var cookie = document.cookie =
  'PHPSESSID='+sessionid+'; expires='+date+'; path=/'

// show me the cookie mmmmm.... cookie
alert(cookie);

 
Adrian Scriptwright

Do you have a DateAdd function in your script? If so, I'm assuming you're using something similar to this:

function DateAdd(timeU,byMany,dateObj) {
	var millisecond=1;
	var second=millisecond*1000;
	var minute=second*60;
	var hour=minute*60;
	var day=hour*24;
	var year=day*365;

	var newDate;
	var dVal=dateObj.valueOf();
	switch(timeU) {
		case "ms": newDate=new Date(dVal+millisecond*byMany); break;
		case "s": newDate=new Date(dVal+second*byMany); break;
		case "mi": newDate=new Date(dVal+minute*byMany); break;
		case "h": newDate=new Date(dVal+hour*byMany); break;
		case "d": newDate=new Date(dVal+day*byMany); break;
		case "y": newDate=new Date(dVal+year*byMany); break;
	}
	return newDate;
}

In which case, you would want to set the date like so:
var date = DateAdd('d', 1, new Date());

Otherwise, just use:
var date = new Date(new Date() + 24*60*60*1000);

 
Keith Hopkins Scriptwright

Thanks Adrian!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel