Rabu, 18 September 2019

[smf_addin] Digest Number 4618

4 Messages

Digest #4618

Messages

Tue Sep 17, 2019 8:39 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

I'm not sure how I did it would help, as it can't be automated via the
add-in. I would assume you'd just need to change the ticker symbol in the
URL. That URL is probably generated somewhere in one of the scripts that is
referenced by the web page.

In any case, the process I used to find the JSON file would be similar to
this discussion I had with someone:

======================================================================================================

The source code of the web page you provided is pretty much bare bones, so
they must be loading data onto it dynamically. The chart page you show
doesn't contain the chart or the data item you show in your image.

If you use Google Chrome the network tab on the on the Developer Tools
option may show you the source of the data?

======================================================================================================

In the Developer Tools, go to the "Network" tab. That will show you all
internet activity going on in Chrome (FireFox has a similar tool).

For example:

1. Go to web page https://finance.yahoo.com/quotes/MCD,MMM/view/v1
2. Start up the "Developer Tools"
3. Go to the "Network" tab
4. Refresh the web page in Chrome. It will show you all of the network
activity from the page refresh.
5. Using the "Filter" input area, type in MCD and hit enter, because it was
a ticker symbol on the web page we're looking at
6. You'll see a list of network activity that used MCD in the URL

Note this URL in the remaining list:

https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US®ion=US&corsDomain=finance.yahoo.com&fields=symbol%2ClongName%2CshortName%2CpriceHint%2CregularMarketPrice%2CregularMarketChange%2CregularMarketChangePercent%2Ccurrency%2CregularMarketTime%2CregularMarketVolume%2Cquantity%2CaverageDailyVolume3Month%2CregularMarketDayHigh%2CregularMarketDayLow%2CregularMarketPrice%2CregularMarketOpen%2CfiftyTwoWeekHigh%2CfiftyTwoWeekLow%2CregularMarketPrice%2CregularMarketOpen%2Csparkline%2CmarketCap&symbols=MCD%2CMMM&formatted=false

That's a version of the JSON call that I use for the
smfGetYahooPortfolioView() function. I just alter the "fields" list and the
"symbols" list. This was how I found the JSON feed.

======================================================================================================

I've been using the Developer Tools option for lots of things.

The "console" area is great for testing JavaScript commands that interact
with a web page. Handy for creating bookmarklets and such. Even creating my
own web page Javascript code, because I can see the results of commands
dynamically. At some point, I may look into Chrome extensions. I'm sure it
would help with those as well.

When looking at a web page in Chrome, the context menu (i.e. right mouse
click) has an "Inspect" option, which brings up the "Elements" tab in
Developer Tools so you can see how that HTML element is constructed on the
web page. That can be handy for checking to see how the add-in might be
able to extract data -- EXCEPT that it is based on the current state of the
dynamically generated source code of the web page and not the retrieved
source code of the web page.

On Tue, Sep 17, 2019 at 2:58 AM Higrm higrm@... wrote:

>
> In the equations you provided below, can you tell me how you got the URL
> "https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks"
> <https://api..nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks>
> ? I looked at the source code for
> "https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks
> <https://api..nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks>"
> but it wasn't anywhere inside that. If ever I would want to try to get
> information using the formulae you've provided here on a different web
> site, I would need to be able to find the correct URL to use. I'm sure the
> slightest typo would cause the formula to fail, so I need to know where to
> get the correct URL to capture the JSON for interpretation.
>
> On Monday, September 16, 2019, 9:50:19 PM GMT+2, Randy Harmelink.... wrote:
>
> There is no first row to pick it up from. The data isn't in the source
> code of the web page itself. The web page is built dynamically from data
> retrieved from a JSON file.
>
> Try these extractions from the JSON file:
>
> =smfStrExtr(smfWord(RCHGetWebData("
> https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks
> <https://api..nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks>
> "),3,"settlementDate"),""":""","""",1)
>
> =smfStrExtr(smfWord(RCHGetWebData("
> https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks
> "),3,"interest"),""":""","""",1)
>
> =smfStrExtr(smfWord(RCHGetWebData("
> https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks
> "),3,"avgDailyShareVolume"),""":""","""",1)
>
> =smfStrExtr(smfWord(RCHGetWebData("
> https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks
> "),3,"daysToCover"),":","}",1)
>
>
> On Mon, Sep 16, 2019 at 11:28 AM naeem_4tk@... wrote:
>
> I am trying to pick short interest data from nasdaq.com but nothing seems
> to be working for the new link i.e.
> https://www.nasdaq.com/market-activity/stocks/aapl/short-interest
>
> Can you please provide me formula to pick data from the first row
> e.g. 08/30/2019.
>
>
>

Wed Sep 18, 2019 5:31 am (PDT) . Posted by:

"Higrm" higrm

Thanks for that step by step guide.  I was using firefox and was in the developers' tools but I guess I didn't refresh and then check out the 'network' tab.  I'll do that now and see if I find the URL you provided below. 

Yes indeed, the problem was I only activated the Developers' Tools after I had refreshed the web page, not before.  Now, refreshing while the tools are activated, I see the URL.  Excellent.  I was even able to edit and send back the GET request with a different ticker.  What a powerful tool.  Thanks again for the education.

Higrm

On Tuesday, September 17, 2019, 5:42:03 PM GMT+2, Randy Harmelink rharmelink@gmail.com [smf_addin] <smf_addin@yahoogroups.com> wrote:

 

I'm not sure how I did it would help, as it can't be automated via the add-in. I would assume you'd just need to change the ticker symbol in the URL. That URL is probably generated somewhere in one of the scripts that is referenced by the web page.
In any case, the process I used to find the JSON file would be similar to this discussion I had with someone:
======================================================================================================
The source code of the web page you provided is pretty much bare bones, so they must be loading data onto it dynamically. The chart page you show doesn't contain the chart or the data item you show in your image.
If you use Google Chrome the network tab on the on the Developer Tools option may show you the source of the data?
======================================================================================================  

In the Developer Tools, go to the "Network" tab. That will show you all internet activity going on in Chrome (FireFox has a similar tool).
For example:
1. Go to web page https://finance.yahoo.com/quotes/MCD,MMM/view/v1 2. Start up the "Developer Tools"3. Go to the "Network" tab4. Refresh the web page in Chrome. It will show you all of the network activity from the page refresh.5. Using the "Filter" input area, type in MCD and hit enter, because it was a ticker symbol on the web page we're looking at6. You'll see a list of network activity that used MCD in the URL
Note this URL in the remaining list:
https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US®ion=US&corsDomain=finance.yahoo.com&fields=symbol%2ClongName%2CshortName%2CpriceHint%2CregularMarketPrice%2CregularMarketChange%2CregularMarketChangePercent%2Ccurrency%2CregularMarketTime%2CregularMarketVolume%2Cquantity%2CaverageDailyVolume3Month%2CregularMarketDayHigh%2CregularMarketDayLow%2CregularMarketPrice%2CregularMarketOpen%2CfiftyTwoWeekHigh%2CfiftyTwoWeekLow%2CregularMarketPrice%2CregularMarketOpen%2Csparkline%2CmarketCap&symbols=MCD%2CMMM&formatted=false

That's a version of the JSON call that I use for the smfGetYahooPortfolioView() function. I just alter the "fields" list and the "symbols" list. This was how I found the JSON feed.
======================================================================================================
I've been using the Developer Tools option for lots of things.
The "console" area is great for testing JavaScript commands that interact with a web page. Handy for creating bookmarklets and such. Even creating my own web page Javascript code, because I can see the results of commands dynamically. At some point, I may look into Chrome extensions. I'm sure it would help with those as well.
When looking at a web page in Chrome, the context menu (i.e. right mouse click) has an "Inspect" option, which brings up the "Elements" tab in Developer Tools so you can see how that HTML element is constructed on the web page. That can be handy for checking to see how the add-in might be able to extract data -- EXCEPT that it is based on the current state of the dynamically generated source code of the web page and not the retrieved source code of the web page.
On Tue, Sep 17, 2019 at 2:58 AM Higrm higrm@... wrote:

In the equations you provided below, can you tell me how you got the URL "https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks" ?  I looked at the source code for "https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks" but it wasn't anywhere inside that.  If ever I would want to try to get information using the formulae you've provided here on a different web site, I would need to be able to find the correct URL to use.  I'm sure the slightest typo would cause the formula to fail, so I need to know where to get the correct URL to capture the JSON for interpretation.

On Monday, September 16, 2019, 9:50:19 PM GMT+2, Randy Harmelink... wrote: There is no first row to pick it up from. The data isn't in the source code of the web page itself. The web page is built dynamically from data retrieved from a JSON file.
Try these extractions from the JSON file:
=smfStrExtr(smfWord(RCHGetWebData("https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks"),3,"settlementDate"),""":""","""",1)

=smfStrExtr(smfWord(RCHGetWebData("https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks"),3,"interest"),""":""","""",1)

=smfStrExtr(smfWord(RCHGetWebData("https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks"),3,"avgDailyShareVolume"),""":""","""",1)

=smfStrExtr(smfWord(RCHGetWebData("https://api.nasdaq.com/api/quote/AAPL/short-interest?assetClass=stocks"),3,"daysToCover"),":","}",1)

On Mon, Sep 16, 2019 at 11:28 AM naeem_4tk@... wrote:

I am trying to pick short interest data from nasdaq.com but nothing seems to be working for the new link i.e. https://www.nasdaq.com/market-activity/stocks/aapl/short-interest

Can you please provide me formula to pick data from the first row e.g. 08/30/2019. 

Tue Sep 17, 2019 9:29 pm (PDT) . Posted by:

mff2805

from this website, for example
https://www.morningstar.com/stocks/xnas/akam/ownership https://www.morningstar.com/stocks/xnas/akam/ownership



I'm interested in Major Institutions Total Top 20 Numbers only, not each one.
it looks like the
% Total Shares held,
Current Shares and
Change Amount
numbers are available. How might one decide in the change is positive or negative.


thanks,
Mike

Tue Sep 17, 2019 10:34 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Sorry, not possible for the add-in as it currently exists, as the web page
is built dynamically from data retrieved from an API, and that API requires
credentials.

On Tue, Sep 17, 2019 at 9:30 PM mff3429@... wrote:

> from this website, for example
>
> https://www.morningstar.com/stocks/xnas/akam/ownership
>
> I'm interested in Major Institutions Total Top 20 Numbers only, not each
> one.
>
> it looks like the
>
> % Total Shares held,
>
> Current Shares and
>
> Change Amount
>
> numbers are available. How might one decide in the change is positive or
> negative.
>
>
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar