Skip to content

Instantly share code, notes, and snippets.

@jeffehobbs
jeffehobbs / simpletwitterweatherbot.py
Last active July 1, 2021 00:03
Simple Python Twitter Weather Bot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tweepy, time, sys, urllib, json
# enter the corresponding information from your Twitter application/Forecast.io API KEY/lat and long:
CONSUMER_KEY = 'YOUR_CONSUMER_KEY'
CONSUMER_SECRET = 'YOUR_CONSUMER_SECRET'
ACCESS_KEY = 'YOUR_ACCESS_KEY'
ACCESS_SECRET = 'YOUR_ACCESS_SECRET'
@jeffehobbs
jeffehobbs / everydaythedometestsus.txt
Last active May 11, 2019 05:44
I Fed The Entire Steven King Book "Under The Dome" Into a Recurrent Neural Network and This Is What Happened
“I’m a passenger,” Norrie said. “The paper with the crosses. And yet to walk the fallow the red at it. It would be find the morning here. This sorry for a lot—either over. “Right the strange that you can’t a shoulder.” She pay exactly distractiation, Thurse I Busin’s voice. Efpillowed over the line. There were five slowly rest of the doorbotioned to kill the restinged at him to the store was teenag. Now he may harded. “A really a mannish who.”
The woman was a spixopolate tramph.
Barbie saw it as a troot. either. It will be breaks, the nobody’s case of using the little one of the roar. “I know wonderful in here, but with Prestine; Rusty, as if it make like the farm, but it felt about that you may know Junior?
“If you tried to come out,” Rusty said. “At lens? That’s a hug silence fifteen,” she lad Pind Mc. you go of the other. Barbie trash when she’d been. They had intented. He wanted to be desk with the right was full good. She had watching.
So this pocket blue down and the finger against the young man i
@jeffehobbs
jeffehobbs / lesson_plan_1-3.txt
Last active March 17, 2016 14:28
Javascript Lesson Plan
#BASIC JAVASCRIPT 101
---
LESSON 1: Getting comfy
You'll need:
* a web browser
* a text editor (I like https://macromates.com/download)
@jeffehobbs
jeffehobbs / convert.py
Last active July 14, 2019 14:13
recursively converts directories of mp3s and m4a files into wav files via pydub library
#!/usr/bin/python
# -*- coding: utf-8 -*-
# convert.py
# 2016 July jhobbs
import os
import argparse
from pydub import AudioSegment
@jeffehobbs
jeffehobbs / wordcount.py
Last active July 12, 2016 20:32
average word/line/character count for text files in directory
#!/usr/bin/env python
import sys, os
DIRECTORY = sys.argv[1]
ARTICLES = 0
LINECOUNT = []
WORDCOUNT = []
CHARACTERCOUNT = []
CONTRAIN_SAMPLE_SIZE = 1000
@jeffehobbs
jeffehobbs / xml-check.py
Created November 21, 2016 19:05
Script to batch check XML feeds via text file input
#!/usr/bin/env python
# d2p-check.py // [email protected] // Oct 2016
import requests, feedparser, arrow, argparse
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", help="input text file containing feed URLS", default="feeds.txt")
parser.add_argument("-f", "--full", help="check feed content", action="store_true")
ARGS = parser.parse_args()
with open (ARGS.input, "r") as myfile:
@jeffehobbs
jeffehobbs / trollbot.py
Created January 29, 2017 16:21
trollbot.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# trollbot.py // Jeff Hobbs // Jan 2016
import os
import logging
import random
import configparser
import tweepy
@jeffehobbs
jeffehobbs / os-check.py
Last active February 27, 2019 20:42
Checks for new versions of ChromeOS, sends an email if they exist. Python 2.7, requires Sparkpost API key and client library to be installed.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# os-check.py // [email protected]
# check chromeOS site for specific updates
import csv, urllib2
from sparkpost import SparkPost
# customize the list of devices, email addresses, and add your own SparkPost API key
@jeffehobbs
jeffehobbs / screenshot.py
Last active November 9, 2018 16:29
Take numerically arranged screenshots with gated timeouts
#!/usr/bin/env python3
# screenshot.py // take screenshots of URLs
import asyncio, argparse, time, os, glob, signal
from time import strftime
from pyppeteer import launch
parser = argparse.ArgumentParser()
parser.add_argument('--site', help='site to screenshot')
args = parser.parse_args()
@jeffehobbs
jeffehobbs / capture_sites.sh
Last active November 9, 2018 18:09
screenshot all sites in list
#!/bin/bash
root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
SITES=("al.com" "cleveland.com" "lehighvalleylive.com" "masslive.com" "mlive.com" "newyorkupstate.com" "nj.com" "nola.com" "oregonlive.com" "pennlive.com" "silive.com" "syracuse.com")
for site in "${SITES[@]}"
do
:
/usr/bin/python3 $root/screenshot.py --site $site
done