Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://www.apispreadsheets.com/import.js"></script>
<script type="text/javascript">
function importComplete(success, data) {
console.log(success)
if (success){
console.log(data);
}
<script>
function SubForm (){
$.ajax({
url:'https://api.apispreadsheets.com/data/jMGwn06FaKODhaKy/',
type:'post',
data:$("#myForm").serializeArray(),
success: function(){
alert("Form Data Submitted :)")
},
error: function(e){
<script>
function SubForm (){
$.ajax({
url:'https://api.apispreadsheets.com/data/jMGwn06FaKODhaKy/',
type:'post',
headers:{
accessKey: "3f7608848c6cb3c4fbf02649c59b7ba5",
secretKey: "255bb6cfdfca9f0cac3c7df9ebc74b3c"
},
data:$("#myForm").serializeArray(),
<!DOCTYPE html>
<html>
<head>
<title>Save Web Form Data to Postgres - Contact Form</title>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
function SubForm (){
<!DOCTYPE html>
<html>
<head>
<title>Save Web Form Data to Postgres - Contact Form</title>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
function SubForm (){
import time
import requests
def time_function(func):
start = time.time()
func()
end = time.time()
return (end-start)
import requests
# pip install requests
import requests
r = requests.post("https://api.apispreadsheets.com/data/your_file_id/", json={"data": [{"title": "The Avengers", "genre": "Action", "director": "Joss Whedon","release_year": 2012},{"title": "Parasite", "genre": "Drama", "director": "Bong Joon-ho","release_year": 2019},{"title": "Knives Out", "genre": "Thriller", "director": "Rian Johnson","release_year": 2019}]})
if r.status_code == 201:
# SUCCESS
{
"data": [
{
"title": "The Avengers",
"genre": "Action",
"director": "Joss Whedon",
"release_year": 2012
},
{
"title": "Parasite",
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://www.apispreadsheets.com/import.js"></script>
<script type="text/javascript">
function importComplete(success, data) {
console.log(success)
if (success){
console.log(data);
// close the importer if you wish
import csv
import math
# Function to write the split file
def create_split_file(split_rows, header, split_file_name):
with open(split_file_name, 'w') as split_file:
output = csv.writer(split_file, delimiter=",")
# Add header to rows if you want
split_rows.insert(0, header)