#!/usr/bin/env python # -*- coding: utf-8 -*- import praw import snudown import datetime import time import re import sys from requests.exceptions import HTTPError """ Customization Configuration """ # Default postID: # postID='15zmjl' # Path to which to output the file # outputFilePath='./' # The Path to the stylesheet, relative to where the html file will be stored # pathToCSS='css/style.css' """ Reddit Post Archiver By Samuel Johnson Stoever """ if len(sys.argv) == 1: print('No post ID was provided. Using default postID.') elif len(sys.argv) > 2: print('Too Many Arguments. Using default postID.') else: postID = sys.argv[1] outputFilePath = outputFilePath + postID + '.html' monthsList = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] def writeHeader(posttitle): htmlFile.write('\n\n
\n') htmlFile.write('\t\n') htmlFile.write('\t\n') htmlFile.write('\t\n') htmlFile.write(postObject.url) htmlFile.write('
\n