Call once, use many..?
-
Hi Bernard,
Wat a super plugin, I love it and I think it will save me a ton of time in the future..! I downloaded the 14 day PRO trial and will very likely purchase it since it is extremely flexible.
Here’s my question. I have an URL which will give me a ton of different data, here’s the limited JSON:
{ "error": false, "message": "", "accounts": [ { "id": 68427, "name": "Account A", "description": "System 1", "accountId": 2089000343, "gain": 401.7403496284, "absGain": 414.83, "daily": 0.08, "monthly": 3.83, "withdrawals": 1470, "deposits": 1050, "interest": -52.1, "profit": 4151.37, "balance": 3682.12, "drawdown": 19.35, "equity": 3682.12, "equityPercent": 100, "demo": false, "lastUpdateDate": "05/30/2014 22:59", "creationDate": "12/06/2010 01:34", "firstTradeDate": "11/05/2010 02:00", "tracking": 763, "views": 190629, "commission": 0, "currency": "USD", "profitFactor": 1.69, "pips": 3345.4, "invitationUrl": "", "server": { "name": "The Collective FX" } }, { "id": 302281, "name": "Account B", "description": "System 2", "accountId": 402270, "gain": 53.8555743912, "absGain": 15.29, "daily": 0.02, "monthly": 1.84, "withdrawals": 126955.99, "deposits": 119018.76, "interest": -205.81, "profit": 18198.4, "balance": 10261.17, "drawdown": 19.17, "equity": 10261.17, "equityPercent": 100, "demo": false, "lastUpdateDate": "05/31/2013 04:55", "creationDate": "05/08/2012 12:36", "firstTradeDate": "06/23/2011 02:00", "tracking": 10, "views": 6494, "commission": 0, "currency": "USD", "profitFactor": 1.27, "pips": 3784.1, "invitationUrl": "", "server": { "name": "Pepperstone" } }, { "id": 487199, "name": "Account 3", "description": "System C", "accountId": 3231769, "gain": -26.1819325195, "absGain": -12.28, "daily": -0.03, "monthly": -2.07, "withdrawals": 186399.2, "deposits": 245542.59, "interest": -694.12, "profit": -30160.71, "balance": 28982.68, "drawdown": 31.54, "equity": 26041.29, "equityPercent": 89.85, "demo": false, "lastUpdateDate": "07/11/2014 22:17", "creationDate": "02/13/2013 13:13", "firstTradeDate": "02/13/2013 02:00", "tracking": 52, "views": 76064, "commission": -20647.02, "currency": "USD", "profitFactor": 0.86, "pips": -3637.3, "invitationUrl": "", "server": { "name": "FinFx" } } }
Here’s what I want to achieve:
I want to show the “gain” for each “accountId” on a page, say in a table. On a different part of the page, I want to show the “daily” values for each “accountId”, etc. And on yet another page, I want to show all the data belonging to each “accountId”.
So far, I think I can solve this but this would mean I would have to call the API each time for data.
Can I solve this by just calling once (per hour – cache settings), using a template (twig?) and then making calls to that template?If we need to take this problem elsewhere, let me know 🙂
Thanks in advance!
- The topic ‘Call once, use many..?’ is closed to new replies.