using System using System Collections Generic using System Linq using

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GrandRating.Services.Net;
using GrandRating.Services;
namespace EbayTrading.CrawlerService {
public class ItemContentGrabber : GrabberBase<IWebContainer>, IItemContentGrabber {
public ItemContentGrabber(ComponentSetup<IWebContainer> setup)
: base(setup) {
RegisterComponent(parser = new ItemContentParser(this.CreateChildSetup<IContainer>("ItemContentParser", this)));
}
readonly ItemContentParser parser;
public ItemContent Execute(long itemId, EbayDomain domain) {
ThrowIfAbortedOrTerminating();
OpenWebSession();
WebSession.Get(string.Format("http://cgi.ebay.{0}/ws/eBayISAPI.dll?ViewItem&item={1}", domain.ToString().ToLower(), itemId));
WebSession.CheckResponseStatus(200);
ApplyResponseEncoding();
return parser.Parse(WebSession.LastResponseBody, domain);
}
}
public interface IItemContentGrabber : IGrabber {
ItemContent Execute(long itemId, EbayDomain domain);
}
}