Author Topic: [FORUM PLUGIN REQUEST] — Embedding Google Sheets, Docs, Presentations, Drawings  (Read 1557 times)

Basically this.  ||  In practice with some code listed in replies.

Can this even be done in this version of SMF even in a plugin?  Youtube embedding has almost no problems so I kinda thought that this might work, too.



Also, regarding this, is there any way to draw data from a range of cells into text in a post?

Like if you have information that you update on a database.  For instance: Score of User A is 3, and the information is stored on
"[spreadsheet_key]","Scores!A2"

Then you have something like
[gs key=spreadsheet_key sheet=Scores range=A2]


And it just inputs the text into the post.

A fun use as an example could be to change the output of a cell to various image links each day by having IF functions on a spreadsheet and time-oriented conditionals, and just put that embedded cell range info within image tags.
« Last Edit: February 02, 2017, 05:35:21 AM by SWAT One »

This would be insanely handy for post-by-post forum adventures

dont think this forums been updated for years so i doubt badspot would do it now

dont think this forums been updated for years so i doubt badspot would do it now
i'm guessing this thread is more a request for a tampermonkey type of plugin, made by another forumer

i'm guessing this thread is more a request for a tampermonkey type of plugin, made by another forumer
Speaking of scripts, Fox made a "quote locked thread" script and I wish it was extended to "too old" posts.

Speaking of scripts, Fox made a "quote locked thread" script and I wish it was extended to "too old" posts.
you can already do that, you just have to enable quick reply. otherwise I'd have added it

how about youtube videos


you can already do that, you just have to enable quick reply. otherwise I'd have added it

TIL

This would be insanely handy for post-by-post forum adventures
Precisely its purpose.  I have spreadsheets for information that is either on a need-to-know basis or a "you haven't discovered this yet so we'll hide this information" basis.

Additionally, with the capacity of auto-updating tables, it makes tiptoeing around BBCode virtually a non-issue.



dont think this forums been updated for years so i doubt badspot would do it now
This thread is more a request for a tampermonkey type of plugin, made by another forumer.
Although, if it could be done officially, that would be nice.

I'd like to make a userscript for this, it'd be neat. but there are issues
first of all, the youtube embedder just gives youtube links the option to embed the video. to everyone without the userscript, it looks like business as usual. what you're suggesting wouldn't work out that way
however, it would be relatively trivial to simply embed a spreadsheet or a document or a presentation when it's linked

as far as showing only certain cells goes, I dunno about that. it's definitely possible to get the values from individual cells or ranges with the sheets API, but it's not practical. there's gotta be an API key and all that stuff, which means either forcing all users to get their own API key from google (an inconvenience) because I definitely don't wanna stick an API key of my own in there, or it means having an intermediate server to hide my API key from the users (another inconvenience, and something I'm unwilling to put up with)

If a spreadsheet were embedded as normal, would it work fine, then?

Also mainly for things like this.  See some things under the "Guides" section of the OP.

https://forum.blockland.us/index.php?topic=307341.0



And, so what you're saying is that there would need to be a server carrying an API key for each embedded object (or each source spreadsheet)?  Just trying to clarify.

One thing that you can do on google sheets is IMPORTANGE, which has the specified fields for a spreadsheet key as well as the sheet and range.  Would such a plugin be able to read custom tags in a post and interpret it as such?  Would an API key still need to be required if it just operated with an IMPORTRANGE kind of function?

Also I am aware that those without the plugin would not see the results of the embedding, but that's when you A) hope that the extension is disseminated, and B) as the poster, post the link with the embedded element so users can see it.



Also, how difficult is it to retain the format of the sheet?
« Last Edit: February 06, 2017, 02:05:38 AM by SWAT One »

If a spreadsheet were embedded as normal, would it work fine, then?
to give the user the option to embed spreadsheets that are otherwise just links, yes, no problem
And, so what you're saying is that there would need to be a server carrying an API key for each embedded object (or each source spreadsheet)?  Just trying to clarify.
Would an API key still need to be required if it just operated with an IMPORTRANGE kind of function?
to use the API, you must have an API key. you only need one, though. the purpose is just to uniquely identify you as a user of the API. either every user of the script could obtain their own key and paste it into the script, or the creator of the script could have their own webserver running its own API that doesn't require a key from clients, which has its own google API key. you don't want to make your API key public, because then anyone could do anything with it and as far as google's concerned you're responsible
Also I am aware that those without the plugin would not see the results of the embedding, but that's when you A) hope that the extension is disseminated, and B) as the poster, post the link with the embedded element so users can see it.
maybe someone else doesn't care, but I'm not gonna make a userscript that inconveniences people without it or looks like gibberish to them. nobody should have to use a userscript to be able to make sense of a forum post. maybe they're on their phone or they like a browser that doesn't have a userscript extension, I dunno
no matter how popular the userscript is, the majority will always be those without it
Also, how difficult is it to retain the format of the sheet?
it should look exactly the same embedded as it does on the google docs website

anyway, I think there's a better solution than pseudo-BBC. just have the normal docs links, with the option to embed them like the youtube script. the spreadsheet key is obviously already in the link, so that's out of the way. for the other stuff, like custom height or width, or maybe ranges, you could have extra URL parameters, which the docs website would ignore so the links still behave normally for people without the script
so like...
https://drive.google.com/open?id=1EQmyG_-GoDZKGe3-DarNFMuU4lhgjaNn7_PUiJJW04A&h=500&w=750
for a height of 500 and width of 750 (pixels? I guess?). maybe one that disables embedding too if you specifically wanted to avoid that

I dunno. this is quickly getting out of hand