Exemplo n.º 1
0
    def get(self):
        username = self.request.get("username").strip()
        if not username:
            self._write_input_error('Missing "username" parameter')
            return
        if not data.is_valid_twitter_username(username):
            self._write_input_error("%s is an invalid Twitter username" % username)
            return

        lists = data.get_lists(username)
        if lists:
            self._write_json([l.slug for l in lists])
        else:
            self._write_error(502)
Exemplo n.º 2
0
    def get(self):
        username = self.request.get('username').strip()
        if not username:
            self._write_input_error('Missing "username" parameter')
            return
        if not data.is_valid_twitter_username(username):
            self._write_input_error('%s is an invalid Twitter username' % username)
            return

        lists = data.get_lists(username)
        if lists:
            self._write_json([l.slug for l in lists])
        else:
            self._write_error(502)
Exemplo n.º 3
0
    def get(self):
        username = self.request.get('username').strip()
        if not username:
            self._write_input_error('Missing "username" parameter')
            return
        if not data.is_valid_twitter_username(username):
            self._write_input_error('%s is an invalid Twitter username' % username)
            return

        lists = data.get_lists(username)
        if lists:
            list_names = []
            for list in lists:
                list_user = list.user
                if list_user and list_user.screen_name != username:
                    continue
                list_names.append(list.slug)
            self._write_json(list_names)
        else:
            self._write_error(502)