Permalink
Browse files

First draft of the LMR Donation Barometer

  • Loading branch information...
1 parent e7ef9c3 commit fda174550f180aa8a06d34719c76ed3fbd74eab7 @mnemonia committed Mar 13, 2012
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>LetsMakeRobotsBarometer</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,31 @@
+package com.letsmakerobots.donation;
+
+import javax.xml.bind.annotation.XmlElement;
+
+public class Donation {
+ private String date;
+ private String name;
+ private String value;
+
+ public String getDate() {
+ return date;
+ }
+ @XmlElement
+ public void setDate(String date) {
+ this.date = date;
+ }
+ public String getName() {
+ return name;
+ }
+ @XmlElement
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getValue() {
+ return value;
+ }
+ @XmlElement
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
@@ -0,0 +1,21 @@
+package com.letsmakerobots.donation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Donations {
+ private Collection<Donation> donations = new ArrayList<Donation>();
+
+ public Collection<Donation> getDonations() {
+ return donations;
+ }
+
+ @XmlElement
+ public void setDonations(Collection<Donation> donations) {
+ this.donations = donations;
+ }
+}
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<donations>
+<donation>
+<name>lvdalen@XXXXX</name>
+<amount>5.00</amount>
+<date>2012-03-12</date>
+</donation>
+<donation><name>grasshopperrocket@XXXXX</name><amount>10.00</amount><date>2012-03-12</date></donation><donation><name>noahm@XXXXX</name><amount>5.00</amount><date>2012-03-12</date></donation><donation><name>b.yoel0@XXXXX</name><amount>5.00</amount><date>2012-03-11</date></donation><donation><name>colton.j.bailey@XXXXX</name><amount>5.00</amount><date>2012-03-10</date></donation><donation><name>acackjay@XXXXX</name><amount>10.00</amount><date>2012-03-10</date></donation><donation><name>admin@XXXXX</name><amount>100.00</amount><date>2012-03-09</date></donation><donation><name>paul@XXXXX</name><amount>5.00</amount><date>2012-03-09</date></donation><donation><name>CKYamada@XXXXX</name><amount>5.00</amount><date>2012-03-09</date></donation><donation><name>telefox@XXXXX</name><amount>15.00</amount><date>2012-03-08</date></donation><donation><name>massavant@XXXXX</name><amount>10.00</amount><date>2012-03-08</date></donation><donation><name>supermif2@XXXXX</name><amount>5.00</amount><date>2012-03-07</date></donation><donation><name>purchasing.BOT@XXXXX</name><amount>10.00</amount><date>2012-03-07</date></donation><donation><name>brushofclint@XXXXX</name><amount>20.00</amount><date>2012-03-07</date></donation><donation><name>jkeneally@XXXXX</name><amount>20.00</amount><date>2012-03-07</date></donation><donation><name>pberns@XXXXX</name><amount>50.00</amount><date>2012-03-07</date></donation><donation><name>Aerospyke@XXXXX</name><amount>6.00</amount><date>2012-03-07</date>
+</donation>
+</donations>
@@ -0,0 +1,20 @@
+package com.letsmakerobots.donation;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+
+public class Main {
+
+ public static void main(String[] args) throws Exception {
+ // Package
+ JAXBContext jc = JAXBContext.newInstance(Donations.class, Donation.class);
+ Unmarshaller unmarshaller = jc.createUnmarshaller();
+
+// Donations donations = (Donations) unmarshaller.unmarshal(new URL("http://www.hactotum.nl/donate/paypal_ipn/dump.php?xml=1"));
+ Donations donations = (Donations) unmarshaller.unmarshal(Donations.class.getResource("Donations.xml").openStream());
+
+ for (Donation d : donations.getDonations()) {
+ System.out.println("Donation: " + d.getName());
+ }
+ }
+}
@@ -0,0 +1,5 @@
+package com.letsmakerobots.donation.barometer;
+
+public interface DonationBarometer {
+ public void create();
+}

0 comments on commit fda1745

Please sign in to comment.