Get the amount of existing existing likes and compare it against maximum & minimum values defined by user
(browser, maximum, minimum, logger)
| 920 | |
| 921 | |
| 922 | def verify_liking(browser, maximum, minimum, logger): |
| 923 | """Get the amount of existing existing likes and compare it against maximum |
| 924 | & minimum values defined by user""" |
| 925 | |
| 926 | post_page = get_additional_data(browser) |
| 927 | likes_count = post_page["graphql"]["shortcode_media"]["edge_media_preview_like"][ |
| 928 | "count" |
| 929 | ] |
| 930 | |
| 931 | if not likes_count: |
| 932 | likes_count = 0 |
| 933 | |
| 934 | if maximum is not None and likes_count > maximum: |
| 935 | logger.info( |
| 936 | "Not liked this post! ~more likes exist off maximum limit at " |
| 937 | "{}".format(likes_count) |
| 938 | ) |
| 939 | return False |
| 940 | elif minimum is not None and likes_count < minimum: |
| 941 | logger.info( |
| 942 | "Not liked this post! ~less likes exist off minimum limit " |
| 943 | "at {}".format(likes_count) |
| 944 | ) |
| 945 | return False |
| 946 | |
| 947 | return True |
| 948 | |
| 949 | |
| 950 | def like_comment(browser, original_comment_text, logger): |
no test coverage detected