Using google spreadsheet as a database for a tumblr theme? - javascript

I am currently using tumblr as a website for my club. On tumblr there is a page, where every club member has a 'profile card' with their name, description and profile image.
I wondered if there is any way to create a google spreadsheet with the members' information and use the spreadsheet as a database, which can be accessed in the tumblr theme's HTML code.
I have been reading about Google App Scripts and JavaScript, but I just can't seem to connect those with tumblr and my idea (and actually I am not sure if tumblr is supporting it either).
So basically what I want to do in the tumblr HTML code is:
-Access a google spreadsheet
-Parse the data into a two-dimensional array
-Use array values to create new div elements
The reason, why I want to do this is because I don't want the members to login in tumblr and go through the hassle to mess with the code. They should be able to easily put their information into a spreadsheet, which is connected to the tumblr website, and every time the spreadsheet is changed, the website just needs to be refreshed and it is again up to date.
I will be thankful for any kind of help =)

I have done a similar task using Google Sheets as a database for small sets of data to be edited by non technical maintainers, and it can work quite well.
You have mentioned that you can add custom Javascript, so it should be possible in your case. Here are the general steps you would take:
Setup your sheet to be accessed via API
Pull data via the Javascript fetch API
Process and display the data on your tumblr site
This actually works quite well and allows for easy updating of what is essentially static data.
For more info on how you can open up your sheet and access it with the API check out this article or ones like it available via Google.

Related

How to commit to a github repo from a website (IN BROWSER) using javascript

I have a website that needs a JSON file to display a sort of timetable that's hosted on GitHub pages. People who do not know what javascript or GitHub are need to be able to change that JSON file each week.
To solve this I've created a website that reads data from a google sheet they can edit, and turns it into a js object at the click of a button. I now just need to get this object from the website into the JSON file on the first GitHub repo, but I have no clue how to do this. I know you can use the GitHub API somehow, but how??
P.s. I know making the token built into the website is a security risk which is why I plan to only put tokens in the google sheet, which requires the user to authenticate a google account before being accessed.

How can I use Google Sheets API as database?

I am trying to write a web application in javascript that reads and writes to a single Google sheet as a database. It basically reads from the sheet, make sure everything is in order, then writes to the sheet. All users will be using the same sheet, however I don't want the sheet to be able to be accessed outside the web application except for trusted users. I have a problem with writing to the sheet, as apparently it has to do O_Auth2 which has such poor documentation(where the hell do I put the key in the PUT request????) and all users would have to sign into my account. I don't think this would really work. Any ideas????
Thanks so much.

How Google analytics can track e-commerce visitors behavior

I am sorry if my question seems to be weird but I can't find any information on the Web..
The question is simple: how Google analytics can be able to track ANY e-commerce website's data?
Websites are different and each one is coded differently so how Google Javascript tag could detect special events like transactions and adding to cart?
Note: I am not talking about simple data like visit duration or seen pages or the URL etc. I am talking about spacial information like:
Visitors commands
Visitors carts
Visitors carts amount
Etc
Basically it works like this. There is a standard piece of javascript for google analytics that is placed on ever page typically done via an include file of some sort that causes it to be included on ever page of the website.
That basically gets you all the standard analytics (visits, page views, etc).
Then if you want ecommerce tracking (like value of orders placed, products ordered, etc) you place a second javascript file on your thank you page and that piece of javascript has parameters for order value, and products on the order (qty and price). You can see more details of the many fields that can be passed about the order here: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
In summary: Outside of the standard analytics that it can collect with the sitewide javascript file, Google Analytics only knows what you tell it. So if you want cart or order tracking, you need to include a special javascript file for that and pass it the information you want to see in Google Analytics.

Is there a way to display data from a private google spreadsheet as a chart on a website?

I am doing a project for my school. I have logged in the number of visitors who come to the school using a car, a bike, a bicycle or some other form of transport on a google spreadsheet. I want to be able to display all the data in the form of charts on my school website in order to keep track of the CO2 emissions caused by people to come to school daily.
I read about the google spreadsheet api but can't understand how to get data from the spreadsheet without making it public.
Any help would be greatly appreciated.
Thanks.
no need to code this in apps script. Google sheets natively supports publishing charts.
https://support.google.com/docs/answer/78052
Depending on how you published the chart, its a different process to update the chart as the data changes.
If you used "publish to the web", simply republish, or modify the URL to remove the range (with some caveats, see this help topic on ways to do it. Its an old post and the new sheets publish url may be different or allow open ranges (like A1:C). https://productforums.google.com/forum/?hl=en#!category-topic/docs/how-do-i/ZRpghByKHNM
If you publish the chart inside a doc or presentation, see http://googleappsupdates.blogspot.pe/2016/05/embed-charts-from-google-sheets-in.html which is a more streamlined way to update the chart, but requires an intermediate doc/slide.
Yes definitely, write code in Google app script to get required data from spreadsheet, deploy your script (anyone even anonymous option), change version of script each time when you are changing code and deploy again.
Get URL of deployed app script, do ajax call to that url from your javascript code (in your web application) and get required data and use it to show chart using any chart plugin from jquery.

Using Google Drive as a database for a login form

Recently i created a website with Godaddy's website builder . In the website there is a free membership, though here is the problem.
Godaddy's website builder doesn't allow you to create a login area, you have to do that with your own tools, and the other problem is website builder does not allow you to upload any files like html or php or install anything like MySql. It does allow you though to put some code in your website. The current way I'm managing the login function is by putting some JavaScript in my website which i found elsewhere , the bad thing is the usernames and passwords are shown in the source code and every time there is a new user i have to change the code. Not only that, the link of the membership area is also in the source code, currently i change it every month. After doing lots of research and finding nothing i had an idea.
By putting a text file on google drive which contains all usernames and passwords, i could make it act as a database. Then put some code in my website which reads the text file in google drive. If this didn't work (Which i think it does) How about using a spreadsheet? And the code on my website reads the spreadsheet. The link to the membership area (Which is also in my website) Could be in another text file.
I'm new with code, and that is really all i need, the code to make this idea work. If anyone can write the code, please post it below. You have no idea how much this will help. Thanks in advance - Braulio
If you can use javascript, you could probably use something like
https://www.firebase.com/
or any other 'database as a service' type thing. This will allow you to query the database, and save to the database with client side javascript.
With firebase you could do something roughly like
var myFirebaseRef = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com/");
myFirebaseRef.set({
username: "Braulio",
password: "pass"
}
});
Just one option
yes you can use a google spreadsheet. yes it will be 100% secure. look at the spreadsheet api for this.
however, beware of the limitations:
there is a limit as to how many cells you can have (in the millions).
since all the requests will be made from the same google account, rate limit quotas will apply, and total daily api calls will be limited (to a few million i think).
if you really will have many users, you can workaround these limitations by caching as much as possible the spreadsheet data in your backend.

Categories