Example #1
0
    def action_request(self):
        titles = API.get_rss_titles_list(self.str_input)
        self.build_response(titles)

        # set the message according to local rules
        if len(self.response.avail_titles) == 0 and len(self.response.unavail_titles) > 0:
            self.response.message = 'Unfortunately no titles listed at your URL are available to ' \
                                    'stream. You might want to set up an alert, or read the FAQs.'

        elif len(self.response.avail_titles) == 0 and len(self.response.unavail_titles) == 0:
            self.response.message = "We couldn't find any titles at your URL. Please read the FAQs"

        elif len(self.response.avail_titles) > 0 and len(self.response.unavail_titles) == 0:
            self.response.message = 'Great! All titles listed at your URL are available to stream!'

        else:
            self.response.message = 'Great! Some titles listed at your URL are available to stream!'