(self)
| 587 | exit(2) |
| 588 | |
| 589 | def get_total_likes(self): |
| 590 | if self.check_private_profile(): |
| 591 | return |
| 592 | |
| 593 | pc.printout("Searching for target total likes...\n") |
| 594 | |
| 595 | like_counter = 0 |
| 596 | posts = 0 |
| 597 | |
| 598 | data = self.__get_feed__() |
| 599 | |
| 600 | for post in data: |
| 601 | like_counter += post['like_count'] |
| 602 | posts += 1 |
| 603 | |
| 604 | if self.writeFile: |
| 605 | file_name = self.output_dir + "/" + self.target + "_likes.txt" |
| 606 | file = open(file_name, "w") |
| 607 | file.write(str(like_counter) + " likes in " + str(like_counter) + " posts\n") |
| 608 | file.close() |
| 609 | |
| 610 | if self.jsonDump: |
| 611 | json_data = { |
| 612 | 'like_counter': like_counter, |
| 613 | 'posts': like_counter |
| 614 | } |
| 615 | json_file_name = self.output_dir + "/" + self.target + "_likes.json" |
| 616 | with open(json_file_name, 'w') as f: |
| 617 | json.dump(json_data, f) |
| 618 | |
| 619 | pc.printout(str(like_counter), pc.MAGENTA) |
| 620 | pc.printout(" likes in " + str(posts) + " posts\n") |
| 621 | |
| 622 | def get_media_type(self): |
| 623 | if self.check_private_profile(): |
nothing calls this directly
no test coverage detected