Offerte Prosper Con l’API di codice di esempio QuickSnipe.java | P2P Prestito, Peer to Peer, Prestito, i popoli finanziamenti

For my ProsperDays presentation this year I will demonstrating bidding with the Prosper API… I have built a quick and dirty bid snipping java program. (This program is not ready for primetime as bid sniping tool, but it is very close and a very effective demo. The reason I say it is not ready is that it lacks memory, meaning that it would bid on the same listing on subsequent passes.) Per la mia presentazione ProsperDays quest ‘anno mi dimostrare l’offerta con l’API di Prosper … ho costruito un rapido e sporco offerta snipping programma Java. (Questo programma non è pronto per prime come offerta Sniping strumento, ma è molto stretta e molto efficace demo . La ragione mi dice che non è pronto è che è priva di memoria, il che significa che sarebbe offerta sulla stessa inserzione sulla successiva passa.)

I think API bidding is the 1st step in a brave new world of Prosper Lending. For one, it easily allows custom models. Credo che l’offerta di API è la 1a tappa di un coraggioso nuovo mondo di Prosper finanziamenti. Da un lato, essa permette facilmente di modelli personalizzati.

So what does this 126 line program do? Che cosa fa questo programma linea 126 fare?

It queries the active AA-C credit grade listings… If a listing passes my extended credit filters (hard coded) AND the minimum Prosper calculated ROI values (generated by Prosper and the floor is passed in as a parameter) AND the minimum time remaining in the auction it will place a validation test bid or a real bid. E ‘attiva la query AA-C credito grado inserzioni … Se passa un elenco esteso il mio credito filtri (difficile in codice) e il minimo Prosper calcolato i valori del ROI (generato da Prosper e la parola è passata come parametro) e il minimo tempo rimanente in l’asta è una prova di convalida offerta o una vera e propria offerta.

What are the extended credit requirements of this code? Quali sono i requisiti di credito esteso di questo codice?Short answer… very tight. Breve risposta … molto stretti.

  • 0 current DQ 0 corrente DQ
  • 0-1 inquires in the last 6 months 0-1 richieste negli ultimi 6 mesi
  • 0 public records in last 10 years 0 registri pubblici negli ultimi 10 anni
  • 0 DQ in last 7 years 0 DQ negli ultimi 7 anni
  • Bankcard utilization between 3% and 80% Bankcard utilizzo tra il 3% e il 80%

Here is the java code (I have contributed this code to the Ecco il codice Java (che ho contribuito a questo codice laSourceForge Prosper API project SourceForge prosperare progetto API). It requires the API classes generated by the Java2WSDL and open source tool by Apache foundation. ). Essa richiede l’API classi generate dal Java2WSDL e tool open source da Apache Foundation.

package prosper.api; prosper.api pacchetto;import java.math.BigDecimal; java.math.BigDecimal importazione;import java.math.MathContext; java.math.MathContext importazione;import java.rmi.RemoteException; java.rmi.RemoteException importazione;import java.sql.Timestamp; java.sql.Timestamp importazione;import java.util.Calendar; java.util.Calendar importazione;import java.util.Iterator; java.util.Iterator importazione;import java.util.TreeMap; java.util.TreeMap importazione;import javax.xml.rpc.ServiceException; javax.xml.rpc.ServiceException importazione;import com.prosper.services.ProsperAPI.DefinitionResult; com.prosper.services.ProsperAPI.DefinitionResult importazione;import com.prosper.services.ProsperAPI.Field; com.prosper.services.ProsperAPI.Field importazione;import com.prosper.services.ProsperAPI.Listing; com.prosper.services.ProsperAPI.Listing importazione;import com.prosper.services.ProsperAPI.ProsperAPILocator; com.prosper.services.ProsperAPI.ProsperAPILocator importazione;import com.prosper.services.ProsperAPI.ProsperAPISoap; com.prosper.services.ProsperAPI.ProsperAPISoap importazione;import com.prosper.services.ProsperAPI.ProsperObject; com.prosper.services.ProsperAPI.ProsperObject importazione;import com.prosper.services.ProsperAPI.ProsperObjectResult; com.prosper.services.ProsperAPI.ProsperObjectResult importazione;public class QuickSnipe public class QuickSnipe{ (private String m_Username; private String m_Username;private String m_Password; private String m_Password;private double m_MinROI; doppio m_MinROI privato;private int m_HoursToGo; int m_HoursToGo privato;private boolean m_PlaceBids; booleano m_PlaceBids privato;private ProsperAPISoap m_APISoap; ProsperAPISoap m_APISoap privato;public QuickSnipe(String username, String password, double minROI, int hoursToGo, boolean placeBids) throws ServiceException QuickSnipe pubblico (String nome utente, password Stringa, in doppio minROI, int hoursToGo, booleano placeBids) getta ServiceException{ (m_Username = username; m_Username = username;m_Password = password; m_Password = password;m_MinROI = minROI; m_MinROI = minROI;m_PlaceBids = placeBids; m_PlaceBids = placeBids;m_HoursToGo = hoursToGo; m_HoursToGo = hoursToGo;m_APISoap = (new ProsperAPILocator()).getProsperAPISoap(); m_APISoap = (nuovo ProsperAPILocator ()). getProsperAPISoap ();} )/** / *** @param args * @ Param args*/ * /public static void main(String[] args) public static void main (String [] args){ (if (args.length!=5) if (args.length! = 5){ (System.err.println(“Usage: QuickSnipe username password minROI hoursToGo PlaceBids”); System.err.println ( “Uso: QuickSnipe username password minROI hoursToGo PlaceBids”);return; ritorno;} )try provare{ (QuickSnipe qs = new QuickSnipe(args[0], args[1], Double.parseDouble(args[2]), Integer.parseInt(args[3]), Boolean.parseBoolean(args[4])); QuickSnipe qs = new QuickSnipe (args [0], args [1], Double.parseDouble (args [2]), Integer.parseInt (args [3]), Boolean.parseBoolean (args [4]));qs.snipe(); qs.snipe ();} )catch (Exception e) catch (Exception e){ (e.printStackTrace(System.err); e.printStackTrace (System.err);} )} )private void snipe() throws Exception private void beccaccino () getta Eccezione{ (DefinitionResult res = m_APISoap.login(m_Username,m_Password); DefinitionResult res = m_APISoap.login (m_Username, m_Password);String token = res.getMessage(); Stringa token = res.getMessage ();ProsperObjectResult por = m_APISoap.query(token, “listing”, getFieldsString(“listing”,true), “status=2 and (creditgrade=7 or creditgrade=6 or creditgrade=5 or creditgrade=4)”); ProsperObjectResult per m_APISoap.query = (token, “elenco”, getFieldsString ( “elenco”, true), “status = 2 e (creditgrade = 7 o creditgrade = 6 o creditgrade = 5 o creditgrade = 4)”);ProsperObject[] pos = por.getProsperObjects(); ProsperObject [] pos = por.getProsperObjects ();TreeMap timeLeftListings = new TreeMap(); TreeMap timeLeftListings = new TreeMap ();for (int i=0; i<pos.length; i++) for (int i = 0; i <pos.length; i + +){ (Listing l = (Listing)pos[i]; Listing l = (Listing) pos [i];Calendar end = (Calendar)l.getStartDate().clone(); Calendario fine = (Calendario) l.getStartDate (). Clone ();end.add(Calendar.HOUR, (l.getDuration()*24)); end.add (Calendar.HOUR, (l.getDuration () * 24));long millisToGo = end.getTimeInMillis() – System.currentTimeMillis(); lungo millisToGo = end.getTimeInMillis () – System.currentTimeMillis ();if (l.getNowDelinquent()==0 //my required extended credit and ROI if (l.getNowDelinquent () == 0 / / la mia richiesta prorogato di credito e il ROI&& (millisToGo/1000/60/60)<=m_HoursToGo & & (MillisToGo/1000/60/60) <= m_HoursToGo&& l.getInquiriesLast6Months()<2 L.getInquiriesLast6Months & & () <2&& l.getPublicRecordsLast10Years()==0 L.getPublicRecordsLast10Years & & () == 0&& l.getDelinquenciesLast7Years()==0 L.getDelinquenciesLast7Years & & () == 0&& l.getBankcardUtilization().doubleValue()<=.8 L.getBankcardUtilization & & (). DoubleValue ()=.03 L.getBankcardUtilization & & (). DoubleValue ()>=. 03&& ((l.getBidMaximumRate().doubleValue()+l.getROINetDefaultRate().doubleValue()+l.getROIInterestAndFeesRate().doubleValue()+l.getROIServicingFeeRate().doubleValue())>=m_MinROI) & & ((L.getBidMaximumRate (). DoubleValue () + l.getROINetDefaultRate (). DoubleValue () + l.getROIInterestAndFeesRate (). DoubleValue () + l.getROIServicingFeeRate (). DoubleValue ())>= m_MinROI) ) { (timeLeftListings.put(end, l); timeLeftListings.put (fine, l);} )} )boolean pause = false; booleano pausa = false;for (Iterator i = timeLeftListings.values().iterator(); i.hasNext(); ) for (Iterator i = timeLeftListings.values (). Iterator (); i.hasNext ();){ (if (pause) // you have to pause to avoid bid throttling se (pausa) / / si hanno per mettere in pausa per evitare offerta throttling{try {Thread.sleep(6000);}catch (Exception ignore){}} (try (Thread.sleep (6000);) catch (Exception ignore) ())Listing l = i.next(); Listing l = i.next ();Timestamp startts = new Timestamp(l.getStartDate().getTimeInMillis()); Startts timestamp = new Timestamp (l.getStartDate (). GetTimeInMillis ());Calendar end = (Calendar)l.getStartDate().clone(); Calendario fine = (Calendario) l.getStartDate (). Clone ();end.add(Calendar.HOUR, (l.getDuration()*24)); end.add (Calendar.HOUR, (l.getDuration () * 24));Timestamp endts = new Timestamp(end.getTimeInMillis()); Endts timestamp = new Timestamp (end.getTimeInMillis ());long hoursToGo = (end.getTimeInMillis() – System.currentTimeMillis())/1000/60/60; lungo hoursToGo = (end.getTimeInMillis () – System.currentTimeMillis ()) / 1000/60/60;System.err.println(“\n”+startts+” + “+l.getDuration()+” days = “+endts+” | Hours To Go: “+hoursToGo); System.err.println ( “\ n” + + startts “+” l.getDuration + () + “giorni =” + endts + “| Ore To Go:” + hoursToGo);System.err.println(“Bid on Listing: “+l.getListingNumber()+”\nAt Rate: “+(m_MinROI-l.getROINetDefaultRate().doubleValue()-l.getROIInterestAndFeesRate().doubleValue()-l.getROIServicingFeeRate().doubleValue())); System.err.println ( “Fai un’offerta per il venditore:” + l.getListingNumber () + “\ nat Tariffa:” + (m_MinROI-l.getROINetDefaultRate (). DoubleValue ()-l.getROIInterestAndFeesRate (). DoubleValue ()-l . getROIServicingFeeRate (). doubleValue ()));res = m_APISoap.bid(token, l.getListingNumber(), new BigDecimal(50,new MathContext(4)), new BigDecimal(m_MinROI-l.getROINetDefaultRate().doubleValue()-l.getROIInterestAndFeesRate().doubleValue()-l.getROIServicingFeeRate().doubleValue(),new MathContext(4)), m_PlaceBids); res = m_APISoap.bid (token, l.getListingNumber (), nuova BigDecimal (50, nuovo MathContext (4)), nuovo BigDecimal (m_MinROI-l.getROINetDefaultRate (). doubleValue ()-l.getROIInterestAndFeesRate (). doubleValue () -l.getROIServicingFeeRate (). doubleValue (), nuova MathContext (4)), m_PlaceBids);pause = true; pausa = true;System.err.println(“Bid Message: “+res.getMessage()); System.err.println ( “Denaro Messaggio:” + res.getMessage ());} )m_APISoap.logout(token); m_APISoap.logout (token);} )private String getFieldsString(String type, boolean authenticated) throws RemoteException private String getFieldsString (String tipo, booleano autenticata) getta RemoteException{ (DefinitionResult res = m_APISoap.describe(null, type); DefinitionResult res = m_APISoap.describe (null, tipo);Field[] fields = res.getDefinition().getFields(); Campo [] = campi res.getDefinition (). Getfields ();int count = 0; int count = 0;String s=””; String s = “”;for (int i=0; i<fields.length; i++) for (int i = 0; i <fields.length; i + +){ (if (authenticated || !fields[i].isAuthenticated()) if (autenticato | |! campi [i]. isAuthenticated ()){ (if (count!=0) if (count! = 0){ (s+= ","; s + = "";} )s+= fields[i].getName(); s + = campi [i]. getName ();count++; count + +;} )} )return s; ritorno s;} )} )If you liked this article, vote for it onSe ti è piaciuto questo articolo, per la votazione sulladel.icio.usdel.icio.usandestumbleuponStumbleUpon..

Categories:Categorie:

Related ArticlesArticoli correlati

Related StoresNegozi correlati

Leave a Reply

Your email address will not be published. Required fields are marked *