- Tag validity
- Price reference
- Length
Note: Capitalization doesn't matter.
about | |
account | |
add | |
admin | |
api | |
app | |
apps | |
archive | |
archives | |
auth |
/** | |
* Utility functions for hashing sets of values, based on the methods described in Ch. 3 of Effective Java | |
*/ | |
public class HashUtil { | |
public static int hash(boolean... args) { | |
int result = 0; | |
for (boolean arg : args) { | |
result += 31 * result + (arg ? 1 : 0); | |
} |
apply plugin: 'java' | |
apply plugin: 'maven-publish' | |
group = 'com.demo' | |
version = '1.0.0' | |
sourceCompatibility = 1.7 | |
repositories { | |
mavenCentral() |
// Make an API request like this: | |
Intent i = new Intent("com.leepapesweers.flashnotifier.API"); | |
// Put flash pattern in request | |
// OPTIONAL | |
ArrayList pattern = new ArrayList(); | |
pattern.add(50); | |
pattern.add(50); | |
i.putIntegerArrayListExtra("flash_pattern", pattern); |
# http://goo.gl/sxbh65 | |
# Presentbot.py | |
import praw | |
import pickle | |
import time | |
# log in | |
# reading login info from a file, it should be username \n password | |
with open("login.properties", "r") as loginFile: | |
login_info = loginFile.readlines() |
You'll need to do the following:
You need to make your bot a python app. Do this by making another directory (can be the same name as the regular one) and put all your python code in that, and make an empty file called __init__.py
in it as well. See how I structured mine if this isn't clear. In your base directory, create two files: "requirements.txt" and "runtime.txt". The requirements.txt file should be the output of pip freeze (you can run the command "pip freeze > requirements.txt"). If you're not using virtualenv, you'll need to go through after and delete all the lines with packages your code doesn't actually use. Check out mine to see what I mean. Runtime.txt just specifies with python version for heroku to use. Mine just has the line "python-2.7.4" in it. All of this will tell heroku to recognize your bot as a python app.
Make a heroku account and
from Queue import Queue # Threadsafe queue for threads to use | |
from collections import Counter # To count stuff for us | |
import datetime # Because datetime printing is hard | |
from pprint import pprint | |
import time # Should be obvious | |
import subprocess # Used to send notifications on mac | |
import sys # Get system info | |
import threading # Should be obvious | |
import json # Also obvious |