add support for single user taste comparisons

master
Casey Link 2011-02-05 13:30:32 -05:00
parent 4352283318
commit 62466723d5
1 changed files with 3 additions and 1 deletions

View File

@ -130,6 +130,8 @@ def tasteometer(phenny, input):
user2 = resolve_username(input2) user2 = resolve_username(input2)
if not user2: if not user2:
user2 = input2 user2 = input2
if not user2 or len(user2) == 0:
user2 = input.nick
try: try:
req = urlopen("%smethod=tasteometer.compare&type1=user&type2=user&value1=%s&value2=%s" % (APIURL, urlquote(user1), urlquote(user2))) req = urlopen("%smethod=tasteometer.compare&type1=user&type2=user&value1=%s&value2=%s" % (APIURL, urlquote(user1), urlquote(user2)))
except HTTPError, e: except HTTPError, e:
@ -172,7 +174,7 @@ def tasteometer(phenny, input):
phenny.say("%s's and %s's musical compatibility rating is %s %s" % (user1, user2, rating, common_artists)) phenny.say("%s's and %s's musical compatibility rating is %s %s" % (user1, user2, rating, common_artists))
tasteometer.rule = (['taste'], r'(\S+)\s+(\S+)') tasteometer.rule = (['taste'], r'(\S+)(?:\s+(\S+))?')
def save_config(): def save_config():
configfile = open(config_filename, 'wb') configfile = open(config_filename, 'wb')