File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const Ebay = require ( '../src/index' ) ;
22
33let ebay = new Ebay ( {
4- clientID : "Ajaykuma-nodeapi-PRD-bf1a91299-ed4deb45 " ,
4+ clientID : "-- Client APP ID ---- " ,
55 limit : 6
66} ) ;
77ebay . findItemsByCategory ( 10181 ) . then ( ( data ) => {
Original file line number Diff line number Diff line change 11const Ebay = require ( '../src/index' ) ;
22
33let ebay = new Ebay ( {
4- clientID : "Ajaykuma-nodeapi-PRD-bf1a91299-ed4deb45 " ,
4+ clientID : "-- Client APP ID ---- " ,
55 limit : 6
66} ) ;
77ebay . findItemsByKeywords ( "iphone" ) . then ( ( data ) => {
Original file line number Diff line number Diff line change 11const Ebay = require ( '../src/index' ) ;
22
33let ebay = new Ebay ( {
4- clientID : "Ajaykuma-nodeapi-PRD-bf1a91299-ed4deb45"
4+ clientID : "-- Client App id ----" ,
5+ details : "childCategories" //optional parameter
56} ) ;
67
78ebay . getAllCategories ( ) . then ( ( data ) => {
Original file line number Diff line number Diff line change 1+ const Ebay = require ( '../src/index' ) ;
2+
3+ let ebay = new Ebay ( {
4+ clientID : "-- Client App ID ----" ,
5+ details : true // To require detailed info or put false
6+ } ) ;
7+ ebay . getUserDetails ( "ajaykumapratha_0" ) . then ( ( data ) => {
8+ console . log ( data ) ;
9+ } , ( error ) => {
10+ console . log ( error ) ;
11+ } ) ;
Original file line number Diff line number Diff line change 11const Ebay = require ( '../src/index' ) ;
22
33let ebay = new Ebay ( {
4- clientID : "Ajaykuma-nodeapi-PRD-bf1a91299-ed4deb45 " ,
4+ clientID : "-- Client APP ID ---- " ,
55 limit : 6
66} ) ;
77ebay . getVersion ( ) . then ( ( data ) => {
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ const buildURL = {
3636 base_url += "appid=" + options . clientID ;
3737 base_url += "&callname=" + options . operationName ;
3838 base_url += "&version=967&siteid=0&responseencoding=JSON&" ;
39- base_url += options . param + "=" + options . name + "&IncludeSelector=ChildCategories" ;
39+ base_url += options . param + "=" + options . name ;
40+ base_url += options . includeSelector ? "&IncludeSelector=" + options . includeSelector : '' ;
4041 //base_url += "&GLOBAL-ID=" + oglobalID;
4142 return base_url ;
4243 } ,
Original file line number Diff line number Diff line change @@ -63,16 +63,30 @@ Ebay.prototype = {
6363 } ,
6464
6565 getVersion : function ( ) {
66- //this.options.name = categoryID ? categoryID : -1;
6766 this . options . operationName = "getVersion" ;
68- //this.options.param = "CategoryID";
6967 let url = urlObject . buildSearchUrl ( this . options ) ;
7068 return makeRequest ( url ) . then ( ( data ) => {
7169 let result = JSON . parse ( data ) ;
7270 return result [ "getVersionResponse" ] [ 0 ] ;
7371 } , ( error ) => {
7472 console . log ( error ) ;
7573 } )
74+ } ,
75+
76+ getUserDetails : function ( userID ) {
77+ this . options . operationName = "GetUserProfile" ;
78+ this . options . param = "UserID" ;
79+ this . options . name = userID ;
80+ this . options . includeSelector = this . options . details ? "Details" : null ;
81+ let url = urlObject . buildShoppingUrl ( this . options ) ;
82+ console . log ( url ) ;
83+ return makeRequest ( url ) . then ( ( data ) => {
84+ let result = JSON . parse ( data ) ;
85+ console . log ( result ) ;
86+ return result ;
87+ } , ( error ) => {
88+ console . log ( error ) ;
89+ } )
7690 }
7791
7892} ;
You can’t perform that action at this time.
0 commit comments