This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function SubForm (){ | |
$.ajax({ | |
url:'https://api.apispreadsheets.com/data/jMGwn06FaKODhaKy/', | |
type:'post', | |
headers:{ | |
accessKey: "3f7608848c6cb3c4fbf02649c59b7ba5", | |
secretKey: "255bb6cfdfca9f0cac3c7df9ebc74b3c" | |
}, | |
data:$("#myForm").serializeArray(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 (){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 (){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
def time_function(func): | |
start = time.time() | |
func() | |
end = time.time() | |
return (end-start) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": [ | |
{ | |
"title": "The Avengers", | |
"genre": "Action", | |
"director": "Joss Whedon", | |
"release_year": 2012 | |
}, | |
{ | |
"title": "Parasite", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
NewerOlder