Skip to content

Instantly share code, notes, and snippets.

View dannyBuonocore's full-sized avatar
🧻
never forget

Danny Buonocore dannyBuonocore

🧻
never forget
View GitHub Profile
@dannyBuonocore
dannyBuonocore / import-alexa.js
Last active December 8, 2021 21:19
Google Sheets script to fetch Alexa ranks
const formatCommas = (num) => num.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
/**
* @customfunction
*/
function IMPORTALEXA(url) {
var output = '';
var fetchedUrl = UrlFetchApp.fetch(
'https://www.alexa.com/siteinfo/' + url,
{ muteHttpExceptions: true }
$('#run').click(() => tryCatch(run));
async function run() {
const response = await fetch(new Request('https://api.livecoinwatch.com/coins/single'), {
method: 'POST',
headers: new Headers({
'content-type': 'application/json',
'x-api-key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
}),
body: JSON.stringify({
function run() {
var response = UrlFetchApp.fetch('https://api.livecoinwatch.com/coins/single', {
'method': 'post',
'headers': {
'Content-type': 'application/json; charset=UTF-8',
'x-api-key': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
},
'payload': JSON.stringify({
"currency": 'USD',
"code": 'ETH',
import requests
import json
payload = {
"currency": "USD",
"sort": "rank",
"order": "ascending",
"offset": 0,
"limit": 50,
"meta": True