Packs/FeedAutofocus/Integrations/FeedAutofocus/FeedAutofocus.py
def build_iterator(self, limit=None, offset=None):
        """Builds a list of indicators.

        Returns:
            list. A list of JSON objects representing indicators fetched from a feed.
        """
        indicators = []  # type:List

        if "Daily Threat Feed" in self.indicator_feeds:
            indicators.extend(self.http_request(feed_type="Daily Threat Feed"))

        if "Custom Feed" in self.indicator_feeds:
            indicators.extend(self.http_request(feed_type="Custom Feed"))

        if limit:
            indicators = indicators[int(offset): int(offset) + int(limit)]

        parsed_indicators = []  # type:List

        for indicator in indicators:
            if indicator:
                indicator_type = self.find_indicator_type(indicator)

                # catch ip of the form X.X.X.X:portNum and extract the IP without the port.
                if indicator_type in [FeedIndicatorType.IP, FeedIndicatorType.CIDR,
                                      FeedIndicatorType.IPv6CIDR, FeedIndicatorType.IPv6] and ":" in indicator:
                    indicator = indicator.split(":", 1)[0]

                parsed_indicators.append({
                    "type": indicator_type,
                    "value": indicator,
                    "rawJSON": {
                        'value': indicator,
                        'type': indicator_type
                    }
                })

        return parsed_indicators
Builds a list of indicators.

        Returns:
            list. A list of JSON objects representing indicators fetched from a feed.
        
Builds a list of indicators.
Builds a list of indicators .
def build_iterator(self, limit=None, offset=None):
        indicators = []  
        if "Daily Threat Feed" in self.indicator_feeds:
            indicators.extend(self.http_request(feed_type="Daily Threat Feed"))
        if "Custom Feed" in self.indicator_feeds:
            indicators.extend(self.http_request(feed_type="Custom Feed"))
        if limit:
            indicators = indicators[int(offset): int(offset) + int(limit)]
        parsed_indicators = []  
        for indicator in indicators:
            if indicator:
                indicator_type = self.find_indicator_type(indicator)
                if indicator_type in [FeedIndicatorType.IP, FeedIndicatorType.CIDR,
                                      FeedIndicatorType.IPv6CIDR, FeedIndicatorType.IPv6] and ":" in indicator:
                    indicator = indicator.split(":", 1)[0]
                parsed_indicators.append({
                    "type": indicator_type,
                    "value": indicator,
                    "rawJSON": {
                        'value': indicator,
                        'type': indicator_type
                    }
                })
        return parsed_indicators
def build_iterator ( self , limit = None , offset = None ) : indicators = [ ] if "Daily Threat Feed" in self . indicator_feeds : indicators . extend ( self . http_request ( feed_type = "Daily Threat Feed" ) ) if "Custom Feed" in self . indicator_feeds : indicators . extend ( self . http_request ( feed_type = "Custom Feed" ) ) if limit : indicators = indicators [ int ( offset ) : int ( offset ) + int ( limit ) ] parsed_indicators = [ ] for indicator in indicators : if indicator : indicator_type = self . find_indicator_type ( indicator ) if indicator_type in [ FeedIndicatorType . IP , FeedIndicatorType . CIDR , FeedIndicatorType . IPv6CIDR , FeedIndicatorType . IPv6 ] and ":" in indicator : indicator = indicator . split ( ":" , 1 ) [ 0 ] parsed_indicators . append ( { "type" : indicator_type , "value" : indicator , "rawJSON" : { 'value' : indicator , 'type' : indicator_type } } ) return parsed_indicators
Builds a list of indicators.
Builds a list of indicators .
"""Builds a list of indicators.

        Returns:
            list. A list of JSON objects representing indicators fetched from a feed.
        """ # type:List # type:List # catch ip of the form X.X.X.X:portNum and extract the IP without the port.
list. A list of JSON objects representing indicators fetched from a feed.
list . A list of JSON objects representing indicators fetched from a feed .
self
limit
offset