MCPcopy
hub / github.com/InstaPy/InstaPy / like_by_feed_generator

Method like_by_feed_generator

instapy/instapy.py:4142–4457  ·  view source on GitHub ↗

Like the users feed :param amount: Specifies how many total likes you want to perform :param randomize: randomly skips posts to be liked on your feed :param unfollow: unfollows the author of a post which was considered inappropriate :param interact: visits t

(
        self,
        amount: int = 50,
        randomize: bool = False,
        unfollow: bool = False,
        interact: bool = False,
    )

Source from the content-addressed store, hash-verified

4140 return self
4141
4142 def like_by_feed_generator(
4143 self,
4144 amount: int = 50,
4145 randomize: bool = False,
4146 unfollow: bool = False,
4147 interact: bool = False,
4148 ):
4149 """
4150 Like the users feed
4151
4152 :param amount: Specifies how many total likes you want to perform
4153 :param randomize: randomly skips posts to be liked on your feed
4154 :param unfollow: unfollows the author of a post which was considered inappropriate
4155 :param interact: visits the author's profile page of a
4156 """
4157
4158 if self.aborting:
4159 return
4160
4161 liked_img = 0
4162 already_liked = 0
4163 inap_img = 0
4164 inap_unfollow = 0
4165 commented = 0
4166 followed = 0
4167 skipped_img = 0
4168 num_of_search = 0
4169 not_valid_users = 0
4170 link_not_found_loop_error = 0
4171
4172 history = []
4173 self.quotient_breach = False
4174
4175 while liked_img < amount:
4176 if self.quotient_breach:
4177 break
4178
4179 try:
4180 # Gets another load of links to be tested
4181 links = get_links_from_feed(
4182 self.browser, amount, num_of_search, self.logger
4183 )
4184
4185 if len(links) > 0:
4186 link_not_found_loop_error = 0
4187
4188 if len(links) == 0:
4189 link_not_found_loop_error += 1
4190 if link_not_found_loop_error >= 10:
4191 self.logger.warning(
4192 "Loop error, 0 links"
4193 " for 10 times consecutively, exit loop"
4194 )
4195 break
4196
4197 except NoSuchElementException:
4198 self.logger.warning("Too few images, aborting")
4199 self.aborting = True

Callers 1

like_by_feedMethod · 0.95

Calls 13

validate_user_callMethod · 0.95
query_clarifaiMethod · 0.95
like_by_usersMethod · 0.95
get_links_from_feedFunction · 0.85
check_linkFunction · 0.85
verify_likingFunction · 0.85
web_address_navigatorFunction · 0.85
like_imageFunction · 0.85
process_commentsFunction · 0.85
sleepFunction · 0.85
follow_restrictionFunction · 0.85
follow_userFunction · 0.85

Tested by

no test coverage detected