Skip to content

Instantly share code, notes, and snippets.

View ilovefreesw's full-sized avatar
🎯
Focusing

Laxman ilovefreesw

🎯
Focusing
View GitHub Profile
@ilovefreesw
ilovefreesw / installer.bat
Created October 28, 2021 10:57
Install Android Apps in Windows 11 by Double Clicking. Make sure Platform-Tools which contains ADB is in PATH.
@echo off
set "package=%1"
adb connect 127.0.0.1:58526
adb install %package%
EXIT /B
pause
@ilovefreesw
ilovefreesw / webhook_code.gs
Created October 20, 2021 04:29
Google Sheet Webhook Receiver. Recives JSON data posted on the webhook URL. Puts timestamp and JSON data in the Google Sheet.
//this is a function that fires when the webapp receives a GET request
function doGet(e) {
return HtmlService.createHtmlOutput("request received");
}
//this is a function that fires when the webapp receives a POST request
function doPost(e) {
var params = JSON.stringify(e.postData.contents);
params = JSON.parse(params);
var myData = JSON.parse(e.postData.contents);
@ilovefreesw
ilovefreesw / wptags.py
Created March 23, 2021 07:03 — forked from Suleman-Elahi/wptags.py
Get All WordPress Tags in Excel (CSV) using WordPress WP API v2
import requests
import csv
import time
from tqdm import tqdm
tags = {}
pages = int(requests.get('https://www.example.com/wp-json/wp/v2/tags').headers['X-WP-TotalPages'])
for i in tqdm(range(pages), ncols=65):
js = requests.get('https://www.example.com/wp-json/wp/v2/tags?page='+str(i+1)).json()
@ilovefreesw
ilovefreesw / code.gs
Last active March 23, 2021 07:13
Google Sheets Apps Script to get WordPress Post ID from URL
function getPostID(link) {
var slug = link.split("/").pop().split(";")[0].replace(".html","");
var url = 'https://www.ilovefreesoftware.com/wp-json/wp/v2/posts?slug='+slug;
var response = JSON.parse(UrlFetchApp.fetch(url).getContentText())
return response[0]['id'];
}
//funtion to get sluf from URL only
/*function getSlug(data) {