public class CredentialDirectScraper extends UrlScraper
Modifier and Type | Field and Description |
---|---|
static String |
COL_DELIM |
private String |
credentialPropertiesFilename_ |
(package private) String |
crLoginFormElement |
(package private) String |
crLoginUrl |
(package private) String |
crPassword |
(package private) String |
crPasswordElement |
(package private) String |
crQuotemediaAuthWebservice |
(package private) String |
crScrapeDatatoolTokenizedUrl |
(package private) String |
crScrapePageUrl |
(package private) String |
crScrapeQuoteEnd |
(package private) String |
crScrapeQuoteStart |
(package private) String |
crScrapeQuoteTokenizedUrl |
(package private) String |
crUserLoginElement |
(package private) String |
crUsername |
private JsonObject |
dataHome |
(package private) String |
datatoolAuthHashToken |
(package private) String |
datatoolAuthToken |
private JsonArray |
holdings |
(package private) String |
quoteSymbolToken |
(package private) HashMap<String,String> |
reqProps |
static String |
SYSTEM_FILE_SEPERATOR
A holder for this clients System File Separator.
|
static String |
SYSTEM_LINE_SEPERATOR
A holder for this clients System line termination separator.
|
static String |
USERHOME
The users home ditrectory.
|
alreadyLoggedIn_, baseUrl_, cm_, connection_, cookies_, dateStr_, debugOut_, marketSymbolCache_, postPageResponse_, rightNow_, stockSymbolCache_, USER_AGENT
Constructor and Description |
---|
CredentialDirectScraper()
Default constructor for the Credential Direct webpage scraper.
|
Modifier and Type | Method and Description |
---|---|
private String |
authenticateQuoteMedia() |
boolean |
doLogin()
Sends the POST to the login url parameters from the classVars.
|
String |
getPortfolioString()
Create the Portfolio data string for the CR account for today.
|
String |
getPortfolioString(boolean resultSetOnly)
Create the Portfolio data string for the CR account for today.
|
String |
getPortfolioSummaryString()
Create the Portfolio Summary data string for the CR account for today.
|
private String |
getQuoteString(String stockSymbol,
String country)
Create the stock QUOTE data string for the given stock symbol for today.
|
String |
getStockDailyString(String stockSymbol)
Create the STOCK_DAILY data string for the given stock symbol for today.
|
private boolean |
loadProperties()
Load the private properties from an external/private file.
|
static void |
main(String[] args) |
String |
right(String value,
int length) |
protected void |
test(String[] args)
Test method to do whatever tests I want.
|
doLogin, doScrape, doScrape, doScrape, doScrape, doScrape, doScrape, doScrape, doScrape, doScrape, getBaseUrl, getConnection, getCookies, getDebugOut, getLoginFormID, getLoginFormParams, getLoginUrl, getPageContent, getPageContent, getPassword, getPasswordFormElementName, getRequestProps, getScrapeEnd, getScrapePageUrl, getScrapeStart, getUsername, getUsernameFormElementName, prettyJson, readFileToString, sendPost, setBaseUrl, setConnection, setCookies, setDebugOut, setDebugOut, setLoginFormID, setLoginUrl, setPassword, setPasswordFormElementName, setRequestProps, setScrapeEnd, setScrapePageUrl, setScrapeStart, setUsername, setUsernameFormElementName, test, toJsonObject, toJsonStructure, writeStringToFile, writeStringToFile
public static final String SYSTEM_FILE_SEPERATOR
public static final String SYSTEM_LINE_SEPERATOR
public static final String COL_DELIM
private String credentialPropertiesFilename_
String crLoginUrl
String crScrapePageUrl
String crQuotemediaAuthWebservice
String quoteSymbolToken
String datatoolAuthToken
String datatoolAuthHashToken
String crScrapeQuoteTokenizedUrl
String crScrapeDatatoolTokenizedUrl
String crScrapeQuoteStart
String crScrapeQuoteEnd
String crLoginFormElement
String crUserLoginElement
String crPasswordElement
String crUsername
String crPassword
private JsonObject dataHome
public CredentialDirectScraper()
private boolean loadProperties()
public boolean doLogin()
doLogin
in class UrlScraper
private String authenticateQuoteMedia() throws Exception
Exception
private String getQuoteString(String stockSymbol, String country)
stockSymbol
- is the Symbol of the stock to lookupcountry
- is the stock market country (US, CA etc)public String getStockDailyString(String stockSymbol)
stockSymbol
- is the Symbol of the stock to lookup *public String getPortfolioSummaryString()
public String getPortfolioString()
public String getPortfolioString(boolean resultSetOnly)
resultSetOnly
- true to return only the default delimited resultSet OR false to send a longer more readable stringprotected void test(String[] args)
test
in class UrlScraper
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses