It is currently March 29th, 2024, 2:01 am

Looking stock graph

General topics related to Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking stock graph

Post by balala »

On that skin we have a URL which returns as image, a graph (eg http://chart.finance.yahoo.com/b?s=USDEUR=X&lang=en-US&region=US). I suppose it would be easy to download and use it.
omaha wrote:function getData(){getDataURL('http://download.finance.yahoo.com/d/quotes.csv?s='+symbolInput1.value+'+'+symbolInput2.value+'+'+symbolInput3.value+'+'+symbolInput4.value+'+'+symbolInput5.value+'+'+symbolInput6.value+'+&f=sl1xn');}function getDataURL(getURL){xmlReq2=new XMLHttpRequest();xmlReq2.open("GET", getURL);xmlReq2.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");xmlReq2.onreadystatechange=retrievedData;xmlReq2.send(null);}function retrievedData(){if (xmlReq2.readyState == 4 && xmlReq2.status == 200)
To be honest, I have no idea what would you like with this code.
omaha
Posts: 12
Joined: August 24th, 2016, 9:23 pm

Re: Looking stock graph

Post by omaha »

balala wrote:On that skin we have a URL which returns as image, a graph (eg http://chart.finance.yahoo.com/b?s=USDEUR=X&lang=en-US&region=US). I suppose it would be easy to download and use it.

To be honest, I have no idea what would you like with this code.
Good! I`ll be happy to use anything.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking stock graph

Post by balala »

omaha wrote:Good! I`ll be happy to use anything.
In this case, it'll be easy:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
CurrencyName11=USD
CurrencyName12=EUR

[MeasureCurrency]
Measure=Plugin
Plugin=WebParser
Url=http://chart.finance.yahoo.com/b?s=#CurrencyName11##CurrencyName12#=X&lang=en-US&region=US
Download=1
DownloadFile=Currency.png
UpdateRate=1800

[MeterCurrency]
Meter=Image
MeasureName=MeasureCurrency
X=0
Y=0
W=320
H=240
PreserveAspectRatio=1
You do not have the required permissions to view the files attached to this post.
omaha
Posts: 12
Joined: August 24th, 2016, 9:23 pm

Re: Looking stock graph

Post by omaha »

balala wrote:In this case, it'll be easy:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
CurrencyName11=USD
CurrencyName12=EUR

[MeasureCurrency]
Measure=Plugin
Plugin=WebParser
Url=http://chart.finance.yahoo.com/b?s=#CurrencyName11##CurrencyName12#=X&lang=en-US&region=US
Download=1
DownloadFile=Currency.png
UpdateRate=1800

[MeterCurrency]
Meter=Image
MeasureName=MeasureCurrency
X=0
Y=0
W=320
H=240
PreserveAspectRatio=1

emm, cool,but i need security market graph, like AAPL,CSCO, IBM etc. I wrote u before...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking stock graph

Post by balala »

omaha wrote:emm, cool,but i need security market graph, like AAPL,CSCO, IBM etc. I wrote u before...
And, as I said it before, for a such thing, we'll need a HTML coded page, where we can get the variation of the values from, let's say, hour to hour.
omaha
Posts: 12
Joined: August 24th, 2016, 9:23 pm

Re: Looking stock graph

Post by omaha »

balala wrote:And, as I said it before, for a such thing, we'll need a HTML coded page, where we can get the variation of the values from, let's say, hour to hour.
Url=http://chart.finance.yahoo.com/z?s=#CurrencyName11#&t
http://chart.finance.yahoo.com/z?s=YHOO&t

Can u do (.rmskin) please ?


.сsv if u need
http://www.canbike.org/information-technology/yahoo-finance-url-download-to-a-csv-file.html
omaha
Posts: 12
Joined: August 24th, 2016, 9:23 pm

Re: Looking stock graph

Post by omaha »

balala wrote:And, as I said it before, for a such thing, we'll need a HTML coded page, where we can get the variation of the values from, let's say, hour to hour.
Hey :welcome:
arty_fish
Posts: 14
Joined: June 7th, 2016, 7:04 am

Re: Looking stock graph

Post by arty_fish »

User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking stock graph

Post by balala »

omaha wrote:Can u do (.rmskin) please ?
No, certainly I can't and don't want! As arty_fish wrote above: https://forum.rainmeter.net/viewtopic.php?p=49194#p49194
But I'll try to help, to create it together.

So, first we'll need a URL to get the exchange rates. For a such task, I used once a xml provided by the European Central Bank: http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml
Because on this URL you get an xml, it'll be easy to work with. We'll read the exchange rates for the last five trading dates.
Now, the following code will read those rates, showing them as a table. The graph is not yet created (this will be the next step):

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Curreny=USD

[MeasureDatesCurrencies]
Measure=Plugin
Plugin=WebParser
UpdateRate=1800
Url=http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml
RegExp="(?siU)</gesmes:Sender><Cube><Cube time="(.*)">.*<Cube currency="#Curreny#" rate="(.*)"/>.*<Cube time="(.*)">.*<Cube currency="#Curreny#" rate="(.*)"/>.*<Cube time="(.*)">.*<Cube currency="#Curreny#" rate="(.*)"/>.*<Cube time="(.*)">.*<Cube currency="#Curreny#" rate="(.*)"/>.*<Cube time="(.*)">.*<Cube currency="#Curreny#" rate="(.*)"/>"

[MeasureDate1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=1

[MeasureCurrency1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=2

[MeasureDate2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=3

[MeasureCurrency2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=4

[MeasureDate3]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=5

[MeasureCurrency3]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=6

[MeasureDate4]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=7

[MeasureCurrency4]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=8

[MeasureDate5]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=9

[MeasureCurrency5]
Measure=Plugin
Plugin=WebParser
Url=[MeasureDatesCurrencies]
StringIndex=10

[MeterCurrency]
MeasureName=MeasureDate1
MeasureName2=MeasureCurrency1
MeasureName3=MeasureDate2
MeasureName4=MeasureCurrency2
MeasureName5=MeasureDate3
MeasureName6=MeasureCurrency3
MeasureName7=MeasureDate4
MeasureName8=MeasureCurrency4
MeasureName9=MeasureDate5
MeasureName10=MeasureCurrency5
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1		%2#CRLF#%3		%4#CRLF#%5		%6#CRLF#%7		%8#CRLF#%9		%10
A great advantage of this approach is that changing the Currency variable, can easily show the exchange rate of any other traded currency.
Now, please take a look at this code and tell me what you think, will this meet your needs?
omaha
Posts: 12
Joined: August 24th, 2016, 9:23 pm

Re: Looking stock graph

Post by omaha »