public class YahooFinanceScraper extends UrlScraper
Modifier and Type | Field and Description |
---|---|
static String |
COL_DELIM |
private JsonObject |
dataHome |
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.
|
private String |
yahooFinanceFilename_ |
(package private) String |
yLoginFormElement |
(package private) String |
yLoginUrl |
(package private) String |
yLoginUrl_plong |
(package private) String |
yLoginUrl_pshort |
(package private) String |
yPassword |
(package private) String |
yPasswordElement |
(package private) String |
yScrapePageUrl |
(package private) String |
yScrapeQuoteEnd |
(package private) String |
yScrapeQuoteStart |
(package private) String |
yScrapeQuoteTokenizedUrl |
(package private) String |
yUserLoginElement |
(package private) String |
yUsername |
alreadyLoggedIn_, baseUrl_, cm_, connection_, cookies_, dateStr_, debugOut_, marketSymbolCache_, postPageResponse_, rightNow_, stockSymbolCache_, USER_AGENT
Constructor and Description |
---|
YahooFinanceScraper()
Default constructor for the Yahoo!
|
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 yahooFinanceFilename_
String yLoginUrl_plong
String yLoginUrl_pshort
String yScrapePageUrl
String quoteSymbolToken
String yScrapeQuoteTokenizedUrl
String yLoginFormElement
String yUserLoginElement
String yPasswordElement
String yScrapeQuoteStart
String yScrapeQuoteEnd
private JsonObject dataHome
public YahooFinanceScraper()
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