Skip to content

Instantly share code, notes, and snippets.

@nawb
nawb / runner.py
Last active August 29, 2015 14:26 — forked from alecxe/runner.py
Self-contained minimum example script to run scrapy
import json
from scrapy.crawler import Crawler
from scrapy.contrib.loader import ItemLoader
from scrapy.contrib.loader.processor import Join, MapCompose, TakeFirst
from scrapy import log, signals, Spider, Item, Field
from scrapy.settings import Settings
from twisted.internet import reactor
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence
import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)