Gesamte Amazon-Ausgaben anzeigen

Aktuell ist es leider nur bei amazon.com möglich den gesamten Bestellverlauf inklusive Gesamtsumme darzustellen. Findige Programmierer haben aber einen javascript-parser geschrieben der das Ganze auch auf amazon.de ermöglicht. Einfach eine Verknüpfung mit dem folgendem Inhalt erstellen, anschließend auf amazon.de einloggen und draufklicken (Wichtig: Der Link funktioniert nur unter Chrome bzw. Firefox, es müssen Pop-Ups für amazon.de erlaubt werden!):

javascript<b></b>:void(function(){!function(){function e(t,r){if(null==t)return null;if(t.className==r)return t;for(var n=0;n&lt;t.childNodes.length;n++){var a=e(t.childNodes[n],r);if(a)return a}return null}function t(e,r){if(null==e)return null;if(e.className==r)return[e];for(var n=[],a=0;a&lt;e.childNodes.length;a++)n=n.concat(t(e.childNodes[a],r));return n}function r(r,n,a){var o=r.getElementsByClassName("order-info"),l=r.getElementsByClassName("a-box-group a-spacing-base");if(m[n].pages[a].done=!0,o.length!=l.length)return void console.log("Syntax Error "+n+"/"+a);for(var s=0;s&lt;o.length;s++){var i={price:"0,00",date:"?",link:"",names:[],prices:[],products:0,recip:""},g=e(o[s],"a-column a-span2");if(g){var c=g.getElementsByClassName("a-color-secondary value");c.length&gt;0?i.price=g.getElementsByClassName("a-color-secondary value")[0].innerHTML.replace(/EUR/,"").replace(/Summe/,"").replace(/.*coins/i,"0,00").trim():i.price="0,00"}else console.log("No price found "+n+"/"+a);var d=e(o[s],"a-column a-span6 recipient a-span-last");if(d){var h=d.getElementsByClassName("trigger-text");h.length&gt;0?i.recip=d.getElementsByClassName("trigger-text")[0].innerHTML.trim():i.recip="?"}else console.log("No recipient found "+n+"/"+a);var p=e(o[s],"a-color-secondary value");p?i.date=p.innerHTML.trim():console.log("No date found "+n+"/"+a);var u=o[s].getElementsByTagName("a")[1];u?i.link=u.href:console.log("No link found "+n+"/"+a);var f=t(l[s],"a-fixed-left-grid-col a-col-right");if(f.length&gt;0){for(var v=[],y=[],N=0;N&lt;f.length;N++){var T=f[N].getElementsByTagName("A");T.length&gt;0?v.push(f[N].getElementsByTagName("A")[0].innerHTML.trim()):v.push(f[N].getElementsByTagName("DIV")[0].innerHTML.trim());var E=e(f[N],"a-size-small a-color-price");E&amp;&amp;y.push(E.textContent.trim())}i.names=v,i.prices=y,i.products=v.length}else console.log("No names found "+n+"/"+a);m[n].pages[a].entries.push(i)}}function n(r,n,a){for(var l=r.getElementsByClassName("a-box-group a-spacing-base"),s=0;s&lt;l.length;s++){var i="",g="",c="",d=l[s].getElementsByClassName("order-info");if(1==d.length){var h=d[0].getElementsByClassName("a-col-right");if(1==h.length){var p=h[0].getElementsByClassName("a-color-secondary value");p.length&gt;0?i=p[0].textContent.trim():console.log("No order number found "+n+"/"+a)}else console.log("No order number found "+n+"/"+a);var u=e(l[s],"a-column a-span2");if(u){var m=u.getElementsByClassName("a-color-secondary value");g=m.length&gt;0?u.getElementsByClassName("a-color-secondary value")[0].innerHTML.replace(/EUR/,"").replace(/Summe/,"").replace(/.*coins/i,"0,00").trim():"0,00"}else console.log("No price found "+n+"/"+a);var v=e(l[s],"a-color-secondary value");v?c=v.innerHTML.trim():console.log("No date found "+n+"/"+a)}for(var y=l[s].getElementsByClassName("a-box shipment"),N=0;N&lt;y.length;N++){var T={orderNumber:i,orderPrice:g,orderDate:c,date:"?",names:[],prices:[],price:0,products:0},E=e(y[N],"a-row shipment-top-row"),v=e(E,"a-size-medium a-color-base a-text-bold");v?T.date=v.innerHTML.trim():console.log("No shipment date found "+n+"/"+a);var b=t(y[N],"a-fixed-left-grid-col a-col-right");if(b.length&gt;0){for(var B=[],x=[],I=0,w=0,C=!1,L=0;L&lt;b.length;L++){var M=b[L].getElementsByTagName("A");M.length&gt;0?B.push(b[L].getElementsByTagName("A")[0].innerHTML.trim()):B.push(b[L].getElementsByTagName("DIV")[0].innerHTML.trim());var H=e(b[L].parentElement,"item-view-qty");H?(H=parseInt(H.textContent.trim()),isNaN(H)&amp;&amp;(H=1)):H=1;var k=e(b[L],"a-size-small a-color-price");if(k){var P=k.textContent.trim();x.push(P);var z=P.replace(/EUR/,"").replace(/Summe/,"").replace(/.*coins/i,"0,00").trim().replace(/\./,"").split(","),A=100*parseInt(z[0])+parseInt(z[1]);isNaN(A)?C=!0:I+=A*H}w+=H}T.names=B,T.prices=x,T.products=w,1==y.length?T.price=g:(T.price=o(I/100),C&amp;&amp;(T.price="*"+T.price))}else console.log("No item names in shpiment found "+n+"/"+a);f.push(T)}}}function a(){for(var e="",t=0;t&lt;m.length;t++){e+=m[t].year+":",0==m[t].pages.length&amp;&amp;(e+=" waiting...");for(var r=0;r&lt;m[t].pages.length;r++)e+=" "+(m[t].pages[r].done?"X":".");e+="\n"}document.body.innerHTML="&lt;pre&gt;"+e+"&lt;/pre&gt;"}function o(e){for(var t=(e.toFixed(2)+"").split("."),r=t[0],n="",a=0;a&lt;r.length-1;a++)n+=r.charAt(a),(r.length-a)%3==1&amp;&amp;(n+=".");return n+=r.charAt(r.length-1),n+","+t[1]}function l(e){return'&lt;tr&gt;&lt;td align="right"&gt;'+e.name+'&lt;/td&gt;&lt;td align="right"&gt;'+o(e.cent/100)+'&lt;/td&gt;&lt;td align="right"&gt;'+e.orders+'&lt;/td&gt;&lt;td align="right"&gt;'+e.products+'&lt;/td&gt;&lt;td align="right"&gt;'+o(e.cent/100/e.products)+'&lt;/td&gt;&lt;td align="right"&gt;'+o(e.cent/100/e.month)+"&lt;/td&gt;&lt;/tr&gt;"}function s(e){for(var t='&lt;ul style="margin:0; padding:0 0 0 2em"&gt;',r=0;r&lt;e.names.length;r++)t+="&lt;li&gt;"+e.names[r]+" | "+e.prices[r]+"&lt;/li&gt;";return t+="&lt;/ul&gt;",'&lt;tr&gt;&lt;td align="center" valign="top"&gt;&lt;a href="'+e.link+'"&gt;Link&lt;/a&gt;&lt;/td&gt;&lt;td align="right" valign="top"&gt;'+e.date+'&lt;/td&gt;&lt;td align="center" valign="top"&gt;'+e.products+'&lt;/td&gt;&lt;td align="right" valign="top"&gt;'+e.price+'&lt;/td&gt;&lt;td align="left" valign="top"&gt;'+e.recip+'&lt;/td&gt;&lt;td align="left" valign="top"&gt;'+t+"&lt;/td&gt;&lt;/tr&gt;"}function i(e){for(var t="",r=0;r&lt;e.names.length;r++)t+=e.names[r]+" | "+e.prices[r]+" # ";return'&lt;tr&gt;&lt;td align="center" valign="top"&gt;'+e.orderNumber+'&lt;/td&gt;&lt;td align="right" valign="top"&gt;'+e.orderDate+'&lt;/td&gt;&lt;td align="center" valign="top"&gt;'+e.orderPrice+'&lt;/td&gt;&lt;td align="right" valign="top"&gt;'+e.date+'&lt;/td&gt;&lt;td align="left" valign="top"&gt;'+e.products+'&lt;/td&gt;&lt;td align="left" valign="top"&gt;'+e.price+'&lt;/td&gt;&lt;td align="left" valign="top"&gt;'+t+"&lt;/td&gt;&lt;/tr&gt;"}function g(){for(var e=new Date,t=""+(1900+e.getYear()),r=e.getMonth()+1,n=[],a=[],o={name:"Insg.",cent:0,orders:0,products:0,month:0},g=0;g&lt;m.length;g++){for(var c=m[g].year.substr(5),d={name:c,cent:0,orders:0,products:0,month:c==t?r:12},h=0;h&lt;m[g].pages.length;h++)for(var p=0;p&lt;m[g].pages[h].entries.length;p++){var u=m[g].pages[h].entries[p],v=u.price.replace(/\./,"").split(","),y=100*parseInt(v[0])+parseInt(v[1]);d.cent+=y,d.products+=u.products,d.orders++,n.push(u)}o.cent+=d.cent,o.products+=d.products,o.orders+=d.orders,o.month+=d.month,a.push(d)}var N="&lt;h2&gt;Uebersicht&lt;/h2&gt;";N+='&lt;table cellspacing="0" cellpadding="4" border="1"&gt;&lt;tr&gt;&lt;th&gt;Jahr&lt;/th&gt;&lt;th&gt;Euro&lt;/th&gt;&lt;th&gt;Bestell.&lt;/th&gt;&lt;th&gt;Produkte&lt;/th&gt;&lt;th&gt;Euro/Prod.&lt;/th&gt;&lt;th&gt;Euro/Monat&lt;/th&gt;&lt;/tr&gt;',N+=l(o);for(var g=0;g&lt;a.length;g++)N+=l(a[g]);N+="&lt;/table&gt;",N+="&lt;h2&gt;Einzel-Bestellungen&lt;/h2&gt;",N+='&lt;table cellspacing="0" cellpadding="4" border="1"&gt;&lt;tr&gt;&lt;th&gt;Link&lt;/th&gt;&lt;th&gt;Datum&lt;/th&gt;&lt;th&gt;Produkte&lt;/th&gt;&lt;th&gt;Preis&lt;/th&gt;&lt;th&gt;Versandadresse&lt;/th&gt;&lt;th&gt;Produktbeschreibungen&lt;/th&gt;&lt;/tr&gt;';for(var g=0;g&lt;n.length;g++)N+=s(n[g]);N+="&lt;/table&gt;",N+="&lt;h2&gt;Lieferungen&lt;/h2&gt;",N+='&lt;table cellspacing="0" cellpadding="4" border="1"&gt;&lt;tr&gt;&lt;th&gt;Bestellnummer&lt;/th&gt;&lt;th&gt;Bestelldatum&lt;/th&gt;&lt;th&gt;Bestellsumme&lt;/th&gt;&lt;th&gt;Lieferdatum&lt;/th&gt;&lt;th&gt;Anzahl Produkte&lt;/th&gt;&lt;th&gt;Summe / Abbuchung&lt;/th&gt;&lt;th&gt;Produkte | Preis&lt;/th&gt;&lt;/tr&gt;';for(var g=0;g&lt;f.length;g++)N+=i(f[g]);N+="&lt;/table&gt;",document.body.innerHTML=N}function c(e){e.currentTarget.onlyOnce||(e.currentTarget.onlyOnce=!0,r(e.currentTarget.document,e.currentTarget.yearIndex,e.currentTarget.pageIndex),n(e.currentTarget.document,e.currentTarget.yearIndex,e.currentTarget.pageIndex),e.currentTarget.close())}function d(e){if(!e.currentTarget.onlyOnce){e.currentTarget.onlyOnce=!0;for(var t=e.currentTarget.document,a=t.getElementsByTagName("a"),o=0,l=0;l&lt;a.length;l++)a[l].href.match(/startIndex=(\d+)/)&amp;&amp;(o=Math.max(o,parseInt(RegExp.$1)));for(var s=e.currentTarget.yearIndex,l=0;o&gt;=l;l+=10)m[s].pages.push({done:!1,entries:[]});r(t,s,0),n(t,s,0);for(var i="https://www.amazon.de/gp/css/order-history/gp/css/order-history/ref=oss_pagination?ie=UTF8&amp;orderFilter="+m[s].year+"&amp;search=&amp;startIndex=",g=1,l=10;o&gt;=l;l+=10){var d=window.open(i+l);d.yearIndex=s,d.pageIndex=g,d.addEventListener("load",c,!0),g++}e.currentTarget.close()}}function h(e){if(!e.currentTarget.onlyOnce){e.currentTarget.onlyOnce=!0;for(var t=e.currentTarget.document,r=t.getElementsByClassName("time-period-chooser a-spacing-none")[0],n=t.getElementsByName("orderFilter")[0],a=0;a&lt;n.options.length;a++){var o=/year-(\d\d\d\d)/;o.exec(n.options[a].value)&amp;&amp;m.push({year:n.options[a].value,pages:[]})}for(var l="https://www.amazon.de/gp/css/order-history?",a=0;a&lt;r.elements.length;a++){var s=r.elements[a];s!=n&amp;&amp;(l+=encodeURIComponent(s.name)+"="+encodeURIComponent(s.value)+"&amp;")}l+="orderFilter=";for(var a=0;a&lt;m.length;a++){var i=window.open(l+m[a].year);i.yearIndex=a,i.addEventListener("load",d,!0)}u=setInterval(p,1e3),e.currentTarget.close()}}function p(){a();for(var e=0;e&lt;m.length;e++){if(0==m[e].pages.length)return;for(var t=0;t&lt;m[e].pages.length;t++)if(!m[e].pages[t].done)return}clearInterval(u),g()}var u,m=[],f=[],v=window.open("https://www.amazon.de/gp/css/order-history/ref=ya_orders_css");v.addEventListener("load",h,!0)}();})();

 

 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.