This file contains hidden or 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
var sh1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); | |
function take_back_up(){ | |
var lrow = sh1.getLastRow(); | |
for(var i=2;i<=lrow;i++){ | |
var url = save_as_doc(sh1.getRange(i, 1).getValue()) | |
Logger.log(url) | |
sh1.getRange(i, 2).setValue(url) |
This file contains hidden or 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
function uploadFiles(url) { | |
var response = UrlFetchApp.fetch(url) | |
var fileName = getFilenameFromURL(url) | |
var folder = DriveApp.getFolderById('1IxMiswEfi67ovoBf8ZH1RV7qVPx1Ks6l'); | |
var blob = response.getBlob(); | |
var file = folder.createFile(blob) | |
file.setName(fileName) | |
file.setDescription("Download from the " + url) | |
return file.getUrl(); |
This file contains hidden or 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
function YouTubeScraper() { | |
var sh1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); | |
var keyword = sh1.getRange("B1").getValue(); | |
var results = YouTube.Search.list('id,snippet', {q:keyword, maxResults:50}); | |
//Video ID Published Date Channel ID "Video Title | |
//" Description Thumbnail URL Channel Title | |
var items = results.items.map(function(e){ | |
return [e.id.videoId, | |
e.snippet.publishedAt, |
This file contains hidden or 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
function connectToMongDB(){ | |
var sh1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1") | |
var rng = sh1.getDataRange().getValues(); | |
for(var i=1;i<rng.length; i++){ | |
var formData = { | |
'name': rng[i][0], | |
'designation':rng[i][1] | |
} |
This file contains hidden or 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
exports = async function(payload) { | |
const mongodb = context.services.get("mongodb-atlas"); | |
const eventsdb = mongodb.db("googlesheetsdb"); | |
const eventscoll = eventsdb.collection("employee_records"); | |
const result= await eventscoll.insertOne(payload.query); | |
var id = result.insertedId.toString(); | |
if(result) { | |
return JSON.stringify(id,false,false); | |
} | |
return { text: `Error saving` }; |
This file contains hidden or 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
function scraper() { | |
/* Create two sheets with name "Settings" and "Scraper".Put your API key in the Setting tab B1 and put your ASIN list | |
in the Scraper tab*/ | |
var apiKey = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Settings").getRange(1, 2).getValue(); | |
var scraperSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Scraper") | |
var lrow = scraperSheet.getLastRow(); |
This file contains hidden or 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
/* | |
Sign up here http://bit.ly/freescraperAPIkey and get the API Key | |
Refer Docs for detailed documentation http://bit.ly/scraperDocs | |
*/ | |
function scrapeInstaFollowers() { |
This file contains hidden or 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
//Google Apps Script. Need to be pasted on the code.gs file | |
function doGet() { | |
var html = HtmlService.createHtmlOutputFromFile('index'); | |
return html.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); | |
} | |
function uploadFiles(data) | |
{ |
This file contains hidden or 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
function getFilesAndFolder() { | |
//Get File by ID | |
var file=DriveApp.getFileById("1_eYdGILxexc7JVJGeKjdcGk-lSwawHTgb12boCWIfF4"); | |
Logger.log(file) | |
//Get Folder by ID and get list of files inside it | |
var files=DriveApp.getFolderById("0Bz7xEwadCXkXSUVhODdGRHVnUkk").getFiles(); | |
while(files.hasNext()) | |
{ | |
Logger.log(files.next()) |
This file contains hidden or 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
function getCryptoPrice() { | |
var sh1=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); | |
var sh2=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2"); | |
//Make sure that you got the API key from Coinmarketcap API dashboard and paste it in sheet_1 on cell B1 | |
var apiKey=sh1.getRange(1, 2).getValue(); | |
var url="https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC" | |
var requestOptions = { | |
method: 'GET', |
NewerOlder