19.06.2017, 07:40
You can get a list of all trends via a db request, then you can call fetch:
Code:
require('trends')
names = db:getlist('SELECT name FROM trends')
dates = {}
dates['start'] = os.date('*t')
dates['start'].year = dates['start'].year - 1
dates['end'] = os.date('*t')
for _, name in ipairs(names) do
data = trends.fetch(name, dates)
end