• First off, excellent plugin.. thank you very much for sharing..

    The alphavantage api allows for the symbol EUR-USD for the forex pair Euror/Dollar and BTC-USD for bitcoin/dollar.

    Your plugin removes the – when entered as symbol=”BTC-USD”. I did modify that line: 1112 in stock-quote.php

    public function sanitize_symbols( $symbols ) {
    $symbols = preg_replace( ‘/[^0-9A-Z\=\.\,\-\:\^]+/’, ”, strtoupper( $symbols ) );

    To allow the hyphen and all works great. Request is that you add that into the plugin.

    Second request is that symbol needs to be uppercase so it would be great if you force that in the shortcode and on the other side, your parameter values to your attributes need to be lowercase, again it would make the plugin easier if that was forced.

    With the change I was able to make the following page: https://mrtopstep.com/top-10-traded-cryptocurrencies

    Thank you for your work sir.

Viewing 1 replies (of 1 total)
  • Hello @marlincobb1,

    Thank you for using Stock Quote and for all interesting tips you provided here!

    Please note, at the moment Stock Quote query AlphaVantage function TIME_SERIES_DAILY which does not fully support such symbol notation (for example, there is no data for EUR-USD but there is data for BTC-USD).

    Foreign Exchange function support that, but along to added dash symbol to sanitize_symbol() method, require more work to mix various AV functions request and responses.
    Also, there is Digital/Crypto exchange for Bitcoin and other cryptocurrencies https://www.alphavantage.co/documentation/#digital-currency so that one also can be considered as an option for crypto’s.

    I added your idea to TODO list for further consideration.

    Meanwhile, you could try my plugin Easy CryptoCurrency Ticker for your page https://www.ads-software.com/plugins/cc-ticker/

    Regarding ‘forced’ upper/lowercase attributes and values for shortcode, I’m not sure that there is suck option in WordPress? Maybe I’m missing something?
    Regarding to plugin page on www.ads-software.com and shortcode instructions on plugin settings page, all parameters are lowercase, while sanitize_symbol() method anyway sanitize symbols and make them uppercase. Jet, I added “important” note to plugin description and settings page about that.

    Kind regards,
    Aleksandar U.

Viewing 1 replies (of 1 total)
  • The topic ‘want to use hypen – in symbol’ is closed to new replies.