JSFiddle - React, Tailwind, and code Playground
HTML
Enter Ebay Store URL: <input type="text" style="width:300px;" value="http://stores.ebay.es/Todo-barato-24h/Galaxy-3-III-I9300-/_i.html?_fsub=3451642014&_sid=183003444&_trksid=p4634.c0.m322"><button onclick="fetchEbayStore(this.previousSibling.value);">Fetch</button><br>
<div id="output"></div>
JavaScript
function getJSON(url) { //quick and dirty, just meant for quick proof of concept, no jquery needed
var script = document.createElement('script');
script.setAttribute('src', url);
script.setAttribute('id', 'jsonScript');
script.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(script);
}
function cbfunc(json){
if(json.query.count){
var data=json.query.results.div;
var i=0, l=data.length, htm='';
for(;i<l;i++){
htm+='<a href="'+data[i].a.href+'">' +
'<img title="'+data[i].a.img.title+'"' +
' src="'+data[i].a.img.src+'">' +
'</a>\n';
}
document.getElementById('output').innerHTML=htm;
} else {
alert('Error: nothing found'); return false;
}
}
function fetchEbayStore(url){
var yql="select a.href, a.img.src, a.img.title" +
" from html" +
" where url='" + url + "'" +
" and xpath='//td/div[@class=\"image\"]'";
yql="http://query.yahooapis.com/v1/public/yql?q=" +
encodeURIComponent(yql) +
"&format=json" +
"&callback=cbfunc";
getJSON(yql);
}