Skip to content

Instantly share code, notes, and snippets.

View jrzmurray's full-sized avatar

J.R. Murray jrzmurray

View GitHub Profile
@jrzmurray
jrzmurray / download_kindle_library_list.js
Created February 15, 2022 16:02
Download Amazon Kindle library listing from browser console @ read.amazon.com to CSV for Goodreads import
// init
let xhr = new XMLHttpRequest()
let domain = 'https://read.amazon.com/'
let items = []
let csvData = ""
// function
function getItemsList(paginationToken = null, callback) {
let url = domain + 'kindle-library/search?query=&libraryType=BOOKS' + ( paginationToken ? '&paginationToken=' + paginationToken : '' ) + '&sortType=recency&querySize=50'
xhr.open('GET', url, async=false)
@jrzmurray
jrzmurray / macros.conf
Last active September 19, 2023 18:23
Helpful Splunk macros
# Capitalize first letters of words in a field (e.g. names)
[upper_first_letters(1)]
args = field
definition = mvjoin(mvmap(split($field$, " "), upper(substr($field$, 1, 1)).substr($field$, 2)), " ")
# Add keywords to subsearch output to improve search performance when values are in the raw events
[subsearch_add_keywords(1)]
args = field
definition = format | eval search=replace(search, "(\b$field$=\"([^\"]+)\")", "\1 \2")