Skip to content

Instantly share code, notes, and snippets.

from slackclient import SlackClient
import requests
import os
from datetime import datetime
import time
last_available = None
notified = False
slack_token = os.environ.get('SLACK_BOT_API_TOKEN')
@grokasm
grokasm / hash_phrase.py
Created February 4, 2016 09:26
A simple command line program to calculate the SHA256 hash digest of a string input
#!/usr/bin/env python
import argparse
import hashlib
import json
def sha256_hash(data):
data_sha256 = hashlib.sha256(json.dumps(data, sort_keys=True)).hexdigest()
return data_sha256
def main():
@grokasm
grokasm / giveaway.py
Last active February 4, 2016 09:21
A script for picking a random winner from a discourse forum topic using a magic word in the post content as an eligibility condition
#!/usr/bin/env python
from urllib import urlencode
import urllib2
import json
import random
import argparse
import hashlib
import time
import os