public class MyPortfolioScraper extends UrlScraper
Modifier and Type | Field and Description |
---|---|
static String |
COL_DELIM |
private JsonObject |
dataHome |
private JsonArray |
holdings |
private String |
myPortfolioFilename_ |
(package private) String |
pLoginFormElement |
(package private) String |
pLoginUrl |
(package private) String |
pPassword |
(package private) String |
pPasswordElement |
(package private) String |
pScrapePageUrl |
(package private) String |
pScrapeQuoteEnd |
(package private) String |
pScrapeQuoteStart |
(package private) String |
pScrapeQuoteTokenizedUrl |
(package private) String |
pUserLoginElement |
(package private) String |
pUsername |
(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 |
---|
MyPortfolioScraper()
Default constructor for the My-portfolio.ca webpage scraper.
|
Modifier and Type | Method and Description |
---|---|
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 myPortfolioFilename_
String pScrapePageUrl
String quoteSymbolToken
String pScrapeQuoteTokenizedUrl
String pLoginFormElement
String pUserLoginElement
String pPasswordElement
String pScrapeQuoteStart
String pScrapeQuoteEnd
private JsonObject dataHome
public MyPortfolioScraper()
private boolean loadProperties()
public boolean doLogin()
doLogin
in class UrlScraper
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