Skip to content

Commit

Permalink
no shouting in the Tavern
Browse files Browse the repository at this point in the history
  • Loading branch information
normalhuman committed Dec 22, 2015
1 parent 9023d18 commit ba4ebc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions globalvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class GlobalVars:
"spanish.stackexchange.com": "SpanishGood.txt", "stats.stackexchange.com": "StatsGood.txt"}

experimental_reasons = ["Code block"] # Don't widely report these
non_tavern_reasons = ["All-caps title"] # Don't report in the Tavern

parser = HTMLParser.HTMLParser()
wrap = Client("stackexchange.com")
Expand Down
9 changes: 5 additions & 4 deletions spamhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def handle_spam(title, body, poster, site, post_url, poster_url, post_id, reason
post_url = to_protocol_relative(url_to_shortlink(post_url))
poster_url = to_protocol_relative(poster_url)
reason = ", ".join(reasons)
reason = reason[:1].upper() + reason[1:]
reason = reason[:1].upper() + reason[1:] # reason is capitalised, unlike the entries of reasons list
append_to_latest_questions(site, post_id, title if not is_answer else "")
if len(reasons) == 1 and ("all-caps title" in reasons or
"repeating characters in title" in reasons or
Expand Down Expand Up @@ -118,9 +118,10 @@ def handle_spam(title, body, poster, site, post_url, poster_url, post_id, reason
chq_pings = get_user_names_on_notification_list("stackexchange.com", GlobalVars.charcoal_room_id, site, GlobalVars.wrap)
chq_msg = append_pings(s, chq_pings)
GlobalVars.charcoal_hq.send_message(chq_msg if len(chq_msg) <= 500 else s)
tavern_pings = get_user_names_on_notification_list("meta.stackexchange.com", GlobalVars.meta_tavern_room_id, site, GlobalVars.wrapm)
tavern_msg = append_pings(s, tavern_pings)
GlobalVars.tavern_on_the_meta.send_message(tavern_msg if len(tavern_msg) <= 500 else s)
if reason not in GlobalVars.non_tavern_reasons:
tavern_pings = get_user_names_on_notification_list("meta.stackexchange.com", GlobalVars.meta_tavern_room_id, site, GlobalVars.wrapm)
tavern_msg = append_pings(s, tavern_pings)
GlobalVars.tavern_on_the_meta.send_message(tavern_msg if len(tavern_msg) <= 500 else s)
if site == "stackoverflow.com":
socvr_pings = get_user_names_on_notification_list("stackoverflow.com", GlobalVars.socvr_room_id, site, GlobalVars.wrapso)
socvr_msg = append_pings(s, socvr_pings)
Expand Down
12 changes: 5 additions & 7 deletions ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@
}, {
"sites": ["askubuntu.com"],
"room": GlobalVars.wrap.get_room("201"),
"unwantedReasons": ["all-caps title",
"phone number detected",
"repeating characters in title",
"repeating characters in body",
"repeating characters in answer",
"link at end of body",
"link at end of answer"]
"unwantedReasons": ["All-caps title", # these should be in uppercased form
"Phone number detected",
"Repeating characters in title",
"Repeating characters in body",
"Repeating characters in answer"]
}, {
"sites": ["puzzling.stackexchange.com"],
"room": GlobalVars.wrap.get_room("21276"),
Expand Down

0 comments on commit ba4ebc9

Please sign in to comment.