This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trends_Log
#4
What do you want to do? Add new trend(1) or download the data(2) from existing trend and operation on this data?

If you want 1) add new trend you should use menu, this has nothing with scripting.

If you want 2) download data then you should do exactly what is in API. For example when you want download last year daily data of trend "Gas" you should paste in a script:
Code:
require('trends')

trend_name = "Gas"

-- get data for the past year
dates = {}
dates['start'] = os.date('*t')
dates['start'].year = dates['start'].year - 1
dates['end'] = os.date('*t')

-- fetch previous value
yearly = trends.fetch(trend_name, dates, 86400)

Then you can operate freely on such data(normal table). You can use it also in function. All is in the manual of Logic Machine and on:
http://openrb.com/docs/
Reply


Messages In This Thread
Trends_Log - by Rodriguez - 03.05.2017, 19:40
RE: Trends_Log - by buuuudzik - 04.05.2017, 12:09
RE: Trends_Log - by Rodriguez - 04.05.2017, 13:22
RE: Trends_Log - by buuuudzik - 04.05.2017, 14:09
RE: Trends_Log - by Rodriguez - 05.05.2017, 13:13
RE: Trends_Log - by buuuudzik - 05.05.2017, 13:21
RE: Trends_Log - by Rodriguez - 05.05.2017, 16:26
RE: Trends_Log - by buuuudzik - 05.05.2017, 17:01
RE: Trends_Log - by Rodriguez - 07.05.2017, 01:28
RE: Trends_Log - by buuuudzik - 07.05.2017, 06:26
RE: Trends_Log - by Rodriguez - 08.05.2017, 16:07
RE: Trends_Log - by buuuudzik - 08.05.2017, 19:37

Forum Jump: