Skip to content

Instantly share code, notes, and snippets.

View SimonS's full-sized avatar

Simon Scarfe SimonS

View GitHub Profile
@SimonS
SimonS / gSpreddit.py
Last active September 27, 2015 02:38
Google Spreadsheet-generated CSV -> Reddit Flair Python script
#!/usr/bin/python
# This is the script we used to use to manage the flair on /r/bjj. It's now useless due to
# reddit doing flair assignment, but left it up for posterity or just in case someone wants
# a working example of reading from a CSV.
import csv, re, time
from urllib2 import urlopen
from redditclient import RedditClient
<!-- this is awesome. typing: -->
div.news-item*3>h2+div.date+p+p+a.link-cta
<!-- followed by ctrl+e in coda generates the following mark-up -->
<div class="news-item">
<h2></h2>
<div class="date"></div>
<p></p>
// test whether file is being called directly.
// define a class
if (strtoupper(__FILE__)==strtoupper($_SERVER['SCRIPT_FILENAME'])) {
// demonstrate class
}