mIRC Home    About    Download    Register    News    Help

Print Thread
ebay socket #149198 15/05/06 04:04 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
I was thinking that i could make an ebay search script but am having no luck. I don't know if anyone has looked at the source for an ebay search but they put all the results on one very large line. The question I have is, if the size of the code is to large does mirc not store it in a var? This is what I have and everytime I try it it skips over the results
Code:
alias ebaysearch {
  set -u10 %ebay.search $2
  sockopen ebay search.ebay.com 80
}
on *:SOCKOPEN:ebay: {
  sockwrite -nt $sockname GET / $+ %ebay.search HTTP/1.0
  sockwrite -nt $sockname HOST: search.ebay.com $+ $crlf $+ $crlf
  sockwrite -nt $sockname Accept-Language: en-us
  sockwrite -nt $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
}

on *:SOCKREAD:ebay: {
  if ($sockerr) {
    echo -s SockError $sockname $sockerr
    return
  }
  else {
    var %temptext
    sockread %temptext
    if (*viewitem* iswm %temptext) { echo -a $gettok(%temptext,2-,62) }
  }
}

Re: ebay socket #149199 15/05/06 04:23 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
You might want that one line to be"
Code:
set -u10 %ebay.search $1-

You have it set for $2, which means it won't return anything if you're only searching for a term with one word. I tried it and it seems to work when I changed that. I noticed a few lines said line too long, and I didn't look over the HTML closely, but it seemed to get results.

Re: ebay socket #149200 15/05/06 05:01 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
even when i changed it to that i get this as result
Quote:
var sViewItemUrl = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem';
cfg.aAlertInfo = [ ["h:h:alt:2","You've been outbid!","icon/iconOutbid_16x16.gif",sViewItemUrl,["item"]],
["h:h:alt:3","Watched Item ending soon!","icon/iconWatchB_16x16.gif",sViewItemUrl,["item"]],
["h:h:alt:4","You've been outbid!","icon/iconOutbid_16x16.gif",sViewItemUrl,["item"]],
["h:h:alt:5","You've received a Second Chance Offer","icon/iconchanceBlu_16x16.gif",sViewItemUrl,["item"]]
var view_item_path = "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=";
ebay.oUtils.oPrefetch.load("http://include.ebaystatic.com/js/e459/us/features/viewitem/viewitem_e4594us.js");
The items never gets listed. No matter how I change it I get that as the result.

Re: ebay socket #149201 15/05/06 02:10 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741

on *:SOCKREAD:ebay: {
if ($sockerr) {
echo -s SockError $sockname $sockerr
return
}
else {
var %temptext
sockread %temptext
if (*viewitem* iswm %temptext) { echo -a $gettok(%temptext,2-,62) }
}
}


var sViewItemUrl = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem';
cfg.aAlertInfo = [ ["h:h:alt:2","You've been outbid!","icon/iconOutbid_16x16.gif",sViewItemUrl,["item"]],
["h:h:alt:3","Watched Item ending soon!","icon/iconWatchB_16x16.gif",sViewItemUrl,["item"]],
["h:h:alt:4","You've been outbid!","icon/iconOutbid_16x16.gif",sViewItemUrl,["item"]],
["h:h:alt:5","You've received a Second Chance Offer","icon/iconchanceBlu_16x16.gif",sViewItemUrl,["item"]]
var view_item_path = "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=";
ebay.oUtils.oPrefetch.load("http://include.ebaystatic.com/js/e459/us/features/viewitem/viewitem_e4594us.js");


It echo's those lines because that is what you told it to do.

Try changing your sockread event like this to see exactly what the page looks like:

Code:
on *:SOCKREAD:ebay: {
if ($sockerr) {
  echo -s SockError $sockname $sockerr
  return
}

  var %temptext
  sockread %temptext
  echo 7 -s > %temptext

}


When you find the exact line you are looking for, you can make your if-statement more precise.

-genius_at_work

Re: ebay socket #149202 16/05/06 01:04 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
thanks for that info. That will make it eaiser to do sockets in the future. It looks like the problem is when it gets to the lines that have the results i get this error
* /echo: line too long (line 19, ebay.mrc)
and i get alot of those. Is there a way around this?

Re: ebay socket #149203 16/05/06 04:19 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You will likely need to use a binary variable. Unfortunately, I'm not too familiar with binary variables, so I won't be able to help you with the specifics.

-genius_at_work

Re: ebay socket #149204 16/05/06 06:41 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
well thats a start. I can try and find out about that and see what i come up with. Thanks for the info though. Just a little direction is all I need smile