Skip to content

Instantly share code, notes, and snippets.

View cspenn's full-sized avatar

Christopher S. Penn cspenn

View GitHub Profile
@cspenn
cspenn / TagSpider.py
Last active May 27, 2020 08:38
GA/GTM Tag Checker in Python and Scrapy
# -*- coding: utf-8 -*-
# Copyright Christopher S. Penn, 2016 | cspenn.com | @cspenn
# This software is licensed under the GNU General Public License, version 3.0.
# Absolutely no warranty or support is provided.
# Run at your own risk.
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
@cspenn
cspenn / docmove.sh
Last active July 15, 2016 11:45
The Document Mover!
# Organize My Documents on a Mac
# Obviously make sure that the subfolders all exist first!
# Copyright © 2016 Christopher Penn
# Released under the GNU General Public License, 3.0
# Absolutely no support or warranty of any kind
DOCS=/path/to/documents # Normally /users/yourusername/documents on a Mac
PDF=/path/to/pdf/files
TEXT=/path/to/text/files
SLIDES=/path/to/presentations/files
@cspenn
cspenn / extractbounces.sh
Last active May 11, 2017 23:51
Extract bouncing email addresses
#!/bin/bash
## Exports known "bad mailbox" error messages plus the line before (which usually contains the RFC822 email) to a text file for you to keep your email list clean
## Assumes you have bash, a file of all your bounces named bounces.txt
## Copyright © 2017 Christopher S. Penn
## Released under the GPL
TERM1="does not exist"
@cspenn
cspenn / makebitlylinks.php
Last active November 1, 2017 19:35
Makes bit.ly links with your designated UTM attribution codes!
@cspenn
cspenn / index.php
Last active November 14, 2021 20:18
Instagram Linktree Substitute with Google Analytics
<?
/*********************************
Instagram Linktree substitute w/GA integration
Inspired by Glenn Walker's PHP-UA
Christopher S. Penn
https://www.christopherspenn.com/
@cspenn
cspenn / make_audiobook.py
Last active June 16, 2022 21:50 — forked from madebyollin/make_audiobook.py
Converts an epub or text file to audiobook via Google Cloud TTS
#!/usr/bin/env python3
"""
Updated 2022-06-16 with removal of enums and types in TTS API, fix of synthesize_speech function
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""