I need this in 24 hours.
I have code that connects to Google's API. It works, it seems in Eclipse but when I run it from the command line I sometimes get an error about "captcha credentials". I need this to run without any user interaction because this code needs to run on a Windows scheduler. In fact I will be running 30 slight variations of this code 30 times a day and without user interaction.
I have run the code that connects to the API in Eclipse and I can get it to write the results of connecting to the API, but I cannot get it to run in the command prompt and when I use in my code as an instantiation of the class. (see error below).
I cannot use Eclipse. I need a solution that I can compile myself from the command prompt. I only know how to use the 'java' command and the 'javac' command so I need your solution to be in a format that will allow just these two commands. Also, the solution should be a separate class that I can instantiate in my main code (as is already done).
In order to do this project you must create your own google finance account. This is easy and takes not more than 2 minutes to do. Of course it is free. I describe what you need to do below.
Here is the error message:
C:\Users\Bill\Desktop\test bed\bin>java -cp .\;[login to view URL];.\[login to view URL];.\gd
[login to view URL];.\[login to view URL];.\[login to view URL];.\[login to view URL];
.\[login to view URL];.\[login to view URL];.\[login to view URL];.\google-collect
[login to view URL];.\[login to view URL];.\[login to view URL];.\[login to view URL] JavaWekaJ48TestTrainPredSQL_updated5
Invalid Credentials!
[login to view URL]$CaptchaRequiredException: Captcha required
at [login to view URL](GoogleAuthTokenFa
[login to view URL])
at [login to view URL](GoogleAuthTokenFactor
[login to view URL])
at [login to view URL](GoogleAuthToken
[login to view URL])
at [login to view URL]([login to view URL])
at [login to view URL]([login to view URL])
at [login to view URL]([login to view URL])
at [login to view URL]([login to view URL]
)
at finance.google.FinancePortfoliosClient.<init>([login to view URL])
at [login to view URL]([login to view URL]
va:63)
NOTE: YOU NEED TO REGISTER FOR GOOGLE FINANCE AND CREATE A PORTFOLIO. THIS IS EASY. IT TAKES 2 MINUTES TO DO.
To use Google Finance you just need a Google account and then go to the Finance page and create a portfolio. A portfolio just consists of one or more stocks. You just enter the stock symbol (like COKE for Coca-cola, F for Ford, DIS for Disney) and then you have Coca-cola in your portfolio, Ford, Disney in your portfolio and that is all you need. Google will then show you info about your stocks. In particular it will show Symbol Last price Change Mkt cap Volume Open High Low. I just need to access LAST PRICE field for each stock in my portfolio. I don't need to write to the portfolio. I just need to acccess these fields.
You need to fill in the username etc in TestFinanceModule.java. The instantiation of the class occurs on lines 59 to 61 of the main code which is in a file called [login to view URL] (note I have removed my passwords from this file).
Code is attached