예제 #1
0
파일: discussion.py 프로젝트: rtsio/myumbc
# Read config files
# If you get a missing section error, you must run this script from the directory
# with the config file, as python determines paths from the point of execution
config = SafeConfigParser()
config.read("config.txt")

myumbc_user = config.get("myumbc", "username")
myumbc_pw = base64.b64decode(config.get("myumbc", "password"))
database_host = config.get("database", "host")
database_user = config.get("database", "username")
database_pw = base64.b64decode(config.get("database", "password"))
database_name = config.get("database", "database")

scraper = Scraper()
db = Database(database_host, database_user, database_pw, database_name)
scraper.login(myumbc_user, myumbc_pw)

# Read in blacklists - ignored threads/comments
blacklist = open("discussion_blacklist.txt", "a+")
blacklisted_threads = blacklist.read().splitlines()
blacklisted_comments = []

arguments = argparse.ArgumentParser()
arguments.add_argument("-start", action="store", type=int, required=True)
arguments.add_argument("-end", action="store", type=int, required=True)
arguments.add_argument("-date", action="store", required=True)
args = arguments.parse_args()

start = args.start
end = args.end + 1
예제 #2
0
파일: generator.py 프로젝트: rtsio/myumbc
	for i in reversed(labels_reverser):
		labels += (i + '|')
			
	return ('&'.join([base_url,first_option_string,labels[:-1],second_option_string,values[:-1],third_option_string]))

config = SafeConfigParser()
config.read('config.txt')

myumbc_user = config.get('myumbc', 'username')
myumbc_pw = base64.b64decode(config.get('myumbc', 'password'))
database_host = config.get('database', 'host')
database_user = config.get('database', 'username')
database_pw = base64.b64decode(config.get('database', 'password'))
database_name = 'myumbc6000'

db = Database(database_host, database_user, database_pw, database_name)
parser = argparse.ArgumentParser(description="Generate common word charts for myUMBC users.")
parser.add_argument('date', help="Date from last scrape (to check if chart needs generating)")
args = parser.parse_args()

avatar_path = "/home/ross/myumbc/avatars/"

first_user = 1
last_user = db.last_user() + 1
blacklist = [0]
# %group/%/medium%"
group_avatar_blacklist = [5738, 4311, 6913, 5789, 4918, 6776, 6826, 6766, 5122, 5130, 6606, 5969, 5448, 4744, 7103, 5284, 6527, 6133, 5858, 6482, 6932, 5911, 6703, 5200, 5258, 6843, 7177, 5139, 7222, 6561, 7457, 5160, 7481, 5216, 7045, 7055, 7059, 5287, 6828, 5294, 5053, 6082, 6855, 5230, 6867, 5354, 5370, 5628]

for x in xrange(first_user, last_user):
	
	if x not in blacklist: