1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Can't Fix API issues (Again)

Discussion in 'Stock Trader Bug Reports' started by Bob, Feb 4, 2015.

Thread Status:
Not open for further replies.
  1. Bob

    Bob Developer Staff Member

    Just posting this to cover any and all bug reports about the API failures. They are not something I can fix as they are on YAHOO's end.

    These are just issues that we are going to have to deal with because Yahoo doesn't support these API's and there are no other API's that are even remotely as good as Yahoo's.
     
  2. Bob

    Bob Developer Staff Member

    A Few new API issues popped up this week. I managed to code around most of them, but some of the issues are just not able to be dealt with via code (server issues).
     
  3. wmtech

    wmtech New Member AMS Premium RMS Premium Showcase Sportsbook

    Code:
    ErrorException: Undefined property: stdClass::$ResultSet - library/NFLJ/StockTrader/Model/Stock.php:1186
    Generated By: ** 1 minute ago
    Stack Trace
    #0 /var/www/***/library/NFLJ/StockTrader/Model/Stock.php(1186): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/var/www/***...', 1186, Array)
    #1 /var/www/***/library/NFLJ/StockTrader/ControllerPublic/StockTrader.php(125): NFLJ_StockTrader_Model_Stock->getAutoCompleteResults('first')
    #2 /var/www/***/library/XenForo/FrontController.php(347): NFLJ_StockTrader_ControllerPublic_StockTrader->actionAutocomplete()
    #3 /var/www/***/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #4 /var/www/***/index.php(13): XenForo_FrontController->run()
    #5 {main}
    Request State
    array(3) {
      ["url"] => string(49) "http://***/stocktrader/autocomplete?term=first"
      ["_GET"] => array(2) {
        ["/stocktrader/autocomplete"] => string(0) ""
        ["term"] => string(5) "first"
      }
      ["_POST"] => array(0) {
      }
    }
    and

    Code:
    ErrorException: Undefined index: TWX - library/NFLJ/StockTrader/Model/Stock.php:631
    Generated By: Unknown Account, Friday at 7:12 PM
    Stack Trace
    #0 /var/www/***/library/NFLJ/StockTrader/Model/Stock.php(631): XenForo_Application::handlePhpError(8, 'Undefined index...', '/var/www/***...', 631, Array)
    #1 /var/www/***/library/NFLJ/StockTrader/ControllerPublic/Portfolio.php(65): NFLJ_StockTrader_Model_Stock->formatUserStockInfo(Array, Array)
    #2 /var/www/***/library/XenForo/FrontController.php(347): NFLJ_StockTrader_ControllerPublic_Portfolio->actionIndex()
    #3 /var/www/***/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #4 /var/www/***/index.php(13): XenForo_FrontController->run()
    #5 {main}
    Request State
    array(3) {
      ["url"] => string(52) "http://***/stocktrader/portfolio/trader.97065/"
      ["_GET"] => array(1) {
        ["/stocktrader/portfolio/trader_97065/"] => string(0) ""
      }
      ["_POST"] => array(0) {
      }
    }
    Most recent version.

    Had to disable the add-on completely as it does not work any more.
     
  4. wmtech

    wmtech New Member AMS Premium RMS Premium Showcase Sportsbook

    This is a quick fix for Model_Stock::getAutoCompleteResults

    Code:
    curl_setopt($ch,CURLOPT_URL,'http://d.yimg.com/aq/autoc?query='.$qterm.'&region=US&lang=en-US&callback=YAHOO.util.ScriptNodeDataSource.callbacks');
    The old URL is deprecated.

    With this fix it seems to work, however "https://finance.yahoo.com/d/quotes.csv" is also deprecated and does not reliably work. You would need to switch to a DOM parsing solution to continue using this add-on.

    See here:
    https://github.com/dirkolbrich/yahoo-finance-query
     
  5. Bob

    Bob Developer Staff Member

    Where has YAHOO announced this? They have not made a single announcement in the past decade related to the Public Stock API since they announced that it was officially unsupported and my be shut down or changed without notice at any time. When ever someone posts on the Yahoo support site, they use the same standard response as they have since the pulled support.

    btw, the "fix" you posted is not using the PUBLIC API (which uses different data sources), its accessing their Web Services (which are private and NOT the same as the Public API). Here is what happens when you attempt to use their Web Services instead of using the Public API: http://www.gummy-stuff.org/Yahoo-data.htm. That site (which is referenced in the github reference that you posted), simple provided how to do stuff like the FIX you posted above that use the finance.yahoo.com web services instead of the public API. Each exchange decides whether the data is available to the PUBLIC API or not (which is why copyright infringement comes into play) as well as things like DELAY TIME (15 minute delay). That is the reason why the data pulled from the Public API is most of the time DIFFERENT than that on FINANACE.YAHOO.COM. You can see this difference when accessing the different data sources via YQL.

    I doubt that they will care too much about the AutoCompleteResults, however, just a heads up that they have shut people down for accessing and using their web services that are NOT part of the PUBLIC API.

    Again, where has YAHOO announced this? The github source you posted (which is 3rd party and not in any way associated with Yahoo.com), uses this (see the API URL in the snippet). Hell, your source isn't even using HTTPS which yahoo announced that all of their API's need to start using HTTPS.
    PHP:
    /****** CSV Querys ******/
        /**
         * query url for quotes via direct .csv query
         *
         * @param array $symbols
         * @return void
         */
        
    private function queryCSV($symbols)
        {
            
    //implode symbols to string
            
    $symbolString implode('+'$symbols);
            
    $paramList $this->setParamList();      
            
    $paramString implode(''array_keys($paramList)); // use only the param keys for csv query
            // set request url
            
    $this->baseUrl 'http://finance.yahoo.com/d/quotes.csv?s=';
            
    $this->queryUrl $this->baseUrl $symbolString '&f=' $paramString '&e=.csv';

    As mentioned above, they are using (if you look at his code) the quotes.csv (that you said is deprecated) OR YQL (which I have explained 100's of times is NOT an option for this addon because YQL is metered). The CSV method that they use is the same as I use (which IS the Public API that yahoo has made available, however, its been unsupported now for at least 10 years).

    It's reasons like this (them not supporting their public API's), that I've chosen to discontinue the addon. The API's are never going to be supported. YQL (Yahoo Query Language) is OK for personal use, however, YQL calls are METERED which make that option unusable for this addon. Obviously, accessing FINANACE.YAHOO.COM Web Services is NOT an option for a public addon (its fine for those that don't care if they get caught, but I can't and won't do that in an addon).

    This is NOT open for Discussion or Debate. I will NOT add code that accesses the Finance.Yahoo.com Web Services. Those Web Services are NOT the Public Stock API. For those that want to use the above fix, you are on your own.
     
  6. SneakyDave

    SneakyDave Member Sportsbook

    Seeing these today, just a temporary thing? This happens looking up a company or stock.

    upload_2015-11-18_10-48-22.png

    array(3) {
    ["url"] => string(65) "http://sneakydave.com/community/stocktrader/autocomplete?term=net"
    ["_GET"] => array(2) {
    ["/community/stocktrader/autocomplete"] => string(0) ""
    ["term"] => string(3) "net"
    }
    ["_POST"] => array(0) {
    }
    }
    #0 /home/nginx/domains/sneakydave.com/public/community/library/NFLJ/StockTrader/Model/Stock.php(1186): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/home/nginx/dom...', 1186, Array)
    #1 /home/nginx/domains/sneakydave.com/public/community/library/NFLJ/StockTrader/ControllerPublic/StockTrader.php(125): NFLJ_StockTrader_Model_Stock->getAutoCompleteResults('net')
    #2 /home/nginx/domains/sneakydave.com/public/community/library/XenForo/FrontController.php(347): NFLJ_StockTrader_ControllerPublic_StockTrader->actionAutocomplete()
    #3 /home/nginx/domains/sneakydave.com/public/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #4 /home/nginx/domains/sneakydave.com/public/community/index.php(13): XenForo_FrontController->run()
    #5 {main}
     
  7. Bob

    Bob Developer Staff Member

    Read the thread below yours (red arrow). You can TRY that, but its not something I can add to the addon itself because its against Yahoo's policy of tying into their personal web services.
    Selection_242.png
     
  8. SneakyDave

    SneakyDave Member Sportsbook

    BUG BUG BUG BUG BUG! Imma gonna SUE !
     
  9. Bob

    Bob Developer Staff Member

    LOL.. OK ADAM... good luck suing YAHOO ;)

    Unfortunately, Its NOT a Stock Trader bug (its not even an API bug) so there is absolutely nothing that anyone (cept yahoo) can do about it. The unsupported public API has been shut down. There is no more public API for auto complete, only their Web Services (which if YOU want to hack into, you are on your own). They've already started shutting people down that are hacking into their Web Services. It looks like they finally (after a decade of saying they might) are pulling the non supported public APIs.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.