data scraping with Yahoo Finance/ StockWatch

    Dec 06 2012 | 9:12 pm
    I finally found the way to alter the StockWatch object so I am able to get more data than the standard 5 data. However, there is something strange going on with the URL. I mailed cycling support but they told me to ask it on the forum, so here is the mail I send them:
    You have to set the features to get teh data you want. For example, with the original object you get 5 data however, if you add some lettercodes to the URL in the JAVA-code you can get more data (for example, I can receive nowthe opening price becasue I added the code o0). I have to add some more stu Now, what is really weird is that when I delete the original lettercodes in the URL and replace them with my featureset, I get errors when I run the object. However, when I leave those codes in place, the object runs fine although I have duplicate data in the beginning and ending of the URL. Here is the original URL: "" here is my URL (this one does not work): ""; Here is my URL but with the beginning and ending from the original (this one works): "";
    I am attaching the Javacode of my object so those who want can have a look

    • Dec 10 2012 | 3:32 pm
      Continuing to delve in the StockWatch object, I found that I can use only lettersymbols like AAPL for Apple. When I try to lookup a stock on international markets for example UMI.BR which is Umicore at the Brussels Stock Exchange, I get an error. Every symbol that has a dot or other sign in it gives me errors. I tried to change the dot to HEXcode but i still get errors. I should probably change something in the code but with my limited JAVA-skills that is quite difficult. Anyone can give me a hand here?
    • Dec 10 2012 | 4:24 pm
      What errors are you getting? Are they coming back from the API call?
    • Dec 11 2012 | 10:30 am
      Let me explain what I do exactly: I took the original Stockwatch object and altered a fw things in the code to get more datapoints. These alterations are: 1) Change the classname into DataScapR 2) change the URL features (more info here on how I did that: 3) change the static final int (adding the new datapooints in this list): For example static final int CHANGEREALTIME = 17 ; 4) Equally expand the atomList until 60 (as there are 60 different datapoints I want to dowload each time): Atom.newAtom(nfo[ 32 ]), 5) As I have 60 datapoints the index counts until 61: if(idx >= 61) break; 6) as well as in the addquotes section: _syms.put(sym, new String[61]);
      Now, When I lookup Apple (AAPL) or Amzon (AMZN) I have no problems. Looking up Umicore (UMI.BR) I get errors but after a minute he gets the data. Looking up Coal India (COALINDIA.BO) I get the following errors:
      Exception in thread "Thread-19" java.lang.NullPointerException at com.cycling74.max.Atom$StringAtom.( at com.cycling74.max.Atom$StringAtom.( at com.cycling74.max.Atom.newAtom( at at
      Strangely enough, on the original StockWatch patch, I do not have this problem but I cannot see what I am doing wrong
      I am adding my class and the altered StockWatch patch so you can have a look. To use it: Clear all quotes using the clear message, then add a quote (UMI.BR, AAPL and COALINDIA.BO) are included and you should only selct one of those, if you want to change clear the slot first to avoid errors. If everything goes ok, you get to see the data in the Max window and the scroller, otherwise you see errors and the scroller freezes.
    • Dec 11 2012 | 3:30 pm
      You'll need to eyeball the data. I'm guessing that something you're getting back means that you aren't fully populating the string arrays indexed by the quote symbols.
    • Dec 11 2012 | 3:32 pm
      I cannot edit my post so here is what I did (and i am still doing): I started from scratch again with the original StockWatch object and started adding one parameter each time and then compile and run it. What I have noticed is: 1) You really cannot take away the features that were available in the original URL 2) You need to add a redundant feature after the normal parameters otherwise you get errors. For now I just add c8 (after hours change). So that does not show up in the print but somehow I do not get errors