[Solved] Pulling multiple values from a string
Posted: July 12th, 2018, 1:54 am
Hi All
I repurposed a skin to track a new ISP data usage (yeah capped data plans still exist) which currently uses a VBscript for a lot of the math work and I've been looking at ways to move it to a lua script.
Give it's my first time even looking at lua outside of some tinkering with WoW addons I'm looking for some suggestions on how to get the data I need to out of the ISPs API call.
The current version of the skin is here - https://github.com/minusInfinite/NuSkopeUsage-Rainmeter
I've attached the current rewrite and have been able to get some basic functions working in just Rainmeter alone.
I'm looking for some guidance on how to do the following.
When the skin is first installed I will need to prompt the user to give their API Key
From some testing I've done with the InputText plugin I should be able to call a skin to capture the API key, change a variable that the api key has been provided and switch the loaded skin file on update?
Change the date format
The API provided is in JSON format. While I have been able to get the Regexp to work and get the data I need I'm not sure how to convert the LastReset entry from YYYY-MM-DD to DD-MM-YYYY or event separate the string to a day and month value to I can use it get like days to next reset, average usage per day and so forth
Table Daily Usage into Monthly Usage
The API also keeps a record of about two months of usage history I've been attempting to read through the documentation and find some way (likely via Lua) of extracting all the those UploadsGB and DownloadGB fields and somehow make a monthly usage bar graph.
I know it's a lot to ask. I'm not looking for someone to build the scripts/skin for me (I'm having a lot of fun doing this rewrite) but suggestions of how to get a few of the addition options would be wonderful.
I repurposed a skin to track a new ISP data usage (yeah capped data plans still exist) which currently uses a VBscript for a lot of the math work and I've been looking at ways to move it to a lua script.
Give it's my first time even looking at lua outside of some tinkering with WoW addons I'm looking for some suggestions on how to get the data I need to out of the ISPs API call.
The current version of the skin is here - https://github.com/minusInfinite/NuSkopeUsage-Rainmeter
I've attached the current rewrite and have been able to get some basic functions working in just Rainmeter alone.
I'm looking for some guidance on how to do the following.
When the skin is first installed I will need to prompt the user to give their API Key
From some testing I've done with the InputText plugin I should be able to call a skin to capture the API key, change a variable that the api key has been provided and switch the loaded skin file on update?
Change the date format
The API provided is in JSON format. While I have been able to get the Regexp to work and get the data I need I'm not sure how to convert the LastReset entry from YYYY-MM-DD to DD-MM-YYYY or event separate the string to a day and month value to I can use it get like days to next reset, average usage per day and so forth
Table Daily Usage into Monthly Usage
The API also keeps a record of about two months of usage history I've been attempting to read through the documentation and find some way (likely via Lua) of extracting all the those UploadsGB and DownloadGB fields and somehow make a monthly usage bar graph.
I know it's a lot to ask. I'm not looking for someone to build the scripts/skin for me (I'm having a lot of fun doing this rewrite) but suggestions of how to get a few of the addition options would be wonderful.