Permalink
Browse files

Allow the number of articles retrieved to be a configurable setting

  • Loading branch information...
marvinpinto committed Mar 18, 2016
1 parent c62a6df commit 7ef05d32728bd4288bfe2763562565e7828bb17b
Showing with 3 additions and 3 deletions.
  1. +3 −3 charlesbot_hello_world/helloworld.py
@@ -17,7 +17,7 @@ def __init__(self):
def load_config(self): # pragma: no cover
config_dict = configuration.get()
self.token = config_dict['helloworld']['config_key']
self.num_articles = config_dict['helloworld']['num_articles']
def get_help_message(self):
help_msg = []
@@ -35,7 +35,7 @@ def process_message(self, message):
return
raw_story_ids = yield from self.get_all_hn_top_stories()
return_attachment = yield from self.print_top_n_hn_stories(5, raw_story_ids)
return_attachment = yield from self.print_top_n_hn_stories(self.num_articles, raw_story_ids)
yield from self.slack.api_call(
'chat.postMessage',
channel=message.channel,
@@ -103,7 +103,7 @@ def schedule_timer_message(self):
@asyncio.coroutine
def send_timer_message(self):
raw_story_ids = yield from self.get_all_hn_new_stories()
return_attachment = yield from self.print_top_n_hn_stories(5, raw_story_ids)
return_attachment = yield from self.print_top_n_hn_stories(self.num_articles, raw_story_ids)
yield from self.slack.api_call(
'chat.postMessage',
channel="#general",

0 comments on commit 7ef05d3

Please sign in to comment.