Пример #1
0
    def like(self, amount=1, ratio='100%', sleep=1):

        ratio = float(ratio.split('%')[0]) / 100

        if self.isLoggedIn():
            helper = GeomatchHelper(browser=self.browser)
            loadingbar = LoadingBar(amount, "likes")
            amount_liked = 0
            # handle one time up front, from then on check after every action instead of before
            self.handlePotentialPopups()
            while amount_liked < amount:
                if random.random() <= ratio:
                    helper.like()
                    amount_liked += 1

                    # update for stats after session ended
                    self.session_data['like'] += 1

                    # update loadingbar display
                    loadingbar.updateLoadingBar(amount_liked)

                else:
                    helper.dislike()

                    # update for stats after session ended
                    self.session_data['dislike'] += 1

                self.handlePotentialPopups()
                time.sleep(sleep)
Пример #2
0
    def like(self, amount=1, ratio='100%', sleep=1):

        ratio = float(ratio.split('%')[0]) / 100

        if self._is_logged_in():
            helper = GeomatchHelper(browser=self.browser)
            amount_liked = 0
            # handle one time up front, from then on check after every action instead of before
            self._handle_potential_popups()
            print("\nLiking profiles started.")
            while amount_liked < amount:
                if random.random() <= ratio:
                    helper.like()
                    amount_liked += 1
                    # update for stats after session ended
                    self.session_data['like'] += 1
                    print(f"{amount_liked}/{amount} liked")

                else:
                    helper.dislike()
                    # update for stats after session ended
                    self.session_data['dislike'] += 1

                self._handle_potential_popups()
                time.sleep(sleep)

            self._print_liked_stats()