Other posts related to ebay

Displaying eBay’s JSON (JSONP) API in a jqGride

December 23, 2009 11:11 am

Ever decide you really hate creating proxy pages to get around cross site ajax?  Me too…  Good thing JSONP is around!  Here is an example I threw together to display eBay items directly from eBay!  (You need your own API key, which is free) This doesn’t include paging, I guess that’ll probably be an addition later. Have to check how flexible the jqGrid is…

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
34
35
36
37
38
<script type="text/javascript">
$(document).ready(function(){
	  jQuery("#list").jqGrid({
	    url:'example.php',
	    datatype: 'xml',
	    mtype: 'GET',
	    colNames:['Inv No','Title'],
	    colModel :[ 
	      {name:'ItemID', index:'ItemID', width:100},
	      {name:'Title', index:'Title', width:400}
	    ],
	    pager: '#pager',
	    rowNum:10,
	    rowList:[10,20,30],
	    sortname: 'invid',
	    sortorder: 'desc',
	    viewrecords: true,
	    caption: 'My first grid'
	  }); 
 
	$.ajax({
	   url: "http://open.api.ebay.com/shopping?callname=FindItems&responseencoding=JSON&appid=__YOUR API KEY HERE__&siteid=0&version=517&QueryKeywords=Rutgers&MaxEntries=50&callback=true",
	   dataType: "jsonp",
	   async: false,
	   jsonp: "_cb_FindItems",
	   processData: false,
	 });
 
});
function _cb_FindItems(array)
{
	array = array.Item;
	//Load jqGrid
	for(var i=0;i<array.length;i++){
		jQuery("#list").addRowData(i, array[i]);
	}
}
</script>

All About Josh

July 27, 2008 10:51 pm

Hello, I’m Josh Owen. I grew up in New Haven, CT and attended Wilbur Cross High School. I was a 4 year captain of the Ice Hockey team, a 2 year captain of the Lacrosse team, and a bench-warmer on the soccer team (at least after my sophomore year when we were good). I managed to graduate in 2004 with honors, without putting in too much effort.

I am attending Rutgers University in New Brunswick, NJ. I will graduate in December, 2008 with a double major in Computer Science and Economics. I played Ice Hockey here for the last four years, and am now out of eligibility. My senior year I was a captain, but was hampered by injuries for most of the year.

For the last 2 years I have worked for a web start up company selling sports collectibles. We are an eBay consignment firm, and I am employee #2 (Employee #1 has left the company). I do database administration and program the back-office software we use. I also write some CRM software and do web development here and there.

Outside the office I play men’s league hockey, and have recently taken up fishing again. I also enjoy going out drinking with the guys and always come back with a story to tell… (I sometimes turn into a bit of a shit-show).

Show me more… »

Get Adobe Flash playerPlugin by wpburn.com wordpress themes