This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEVICES = 1000 * 15 # Only call the API once every 15 seconds. | |
path = require 'path' | |
google = require 'googleapis' | |
key = require './config/analytics.json' # This is the key Google Developer has you download upon service account creation. | |
express = require 'express' | |
http = require 'http' | |
https = require 'https' | |
analytics = google.analytics 'v3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
client_id = 'XXXXXXXX' | |
client_secret = 'XXXXXXXX' | |
refresh_token = 'XXXXXXXX' | |
reddit = praw.Reddit(client_id=client_id, client_secret=client_secret, refresh_token=refresh_token user_agent='Skrapr') | |
crawl_subreddits = ['sub1', 'sub2', 'sub3'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
def create_watermark(image_path, final_image_path, watermark, hires=False): | |
main = Image.open(image_path) | |
mark = Image.open(watermark) | |
mark = mark.rotate(30, expand=1) | |
mask = mark.convert('L').point(lambda x: min(x, 25)) | |
mark.putalpha(mask) | |
mark_width, mark_height = mark.size | |
main_width, main_height = main.size |