plugins - Looking for a solution - slightly convoluted problem

OK so stick with me on this one... it's a little involved. I won't describe it all, I'll simplify things

OK so stick with me on this one... it's a little involved. I won't describe it all, I'll simplify things as best I can to the basics.

OK so, on my wordpress site I have three text boxes (BOX1,BOX2,BOX3). These need to display specific numbers, that are brought in live from a Google Sheets table. If the table gets updated, these boxes need to update immediately (on page refresh). I have this working already using this, which means all I need to do is put a shortcode into each text box, and it automatically displays the right data. Which is working fine... except that I actually have about 20 of these boxes, and google has a limit of 10 API calls per second. So a page refresh takes several seconds.

An alternative is to simply embed or autofill a Tablepress or similar table, and grab the entire Google Sheets table with one request. But these tables can only be formatted -as- tables, which isn't what I want.

So what I would LIKE to do (but which may not be possible), is to somehow change this into two steps = 1. Use a single shortcode or other trigger to grab the entire Google Sheets table in a single API call. (or at least grab 1 entire field per call, if splitting it up makes step 2 easier, it'd still mean only 3 calls instead of 20). 2. Then use seperate shortcodes (or whatever) in each text box like I am now, to select what cell's data appears in which box.

I suspect the answer may lie in some kind of... grabbing the Sheets data into Arrays, and then parsing the arrays with calls that show "item1" or "item5". The data will always be in a consistent order, so I guess this might work. I have zero idea how it might be done though, and I'm not sure how you'd grab the data from Sheets.

Hence being here, just to see if there's a method or solution that is escaping me. I'm suspecting I won't get any replies lol, but worth a try.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745103348a4611408.html

相关推荐

  • plugins - Looking for a solution - slightly convoluted problem

    OK so stick with me on this one... it's a little involved. I won't describe it all, I'll simplify things

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信