This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_active_users(browser, username, posts, logger): | |
"""Returns a list with users who liked the latest posts""" | |
browser.get('https://www.instagram.com/' + username) | |
sleep(2) | |
total_posts = formatNumber(browser.find_element_by_xpath( | |
"//span[contains(@class,'_t98z6')]//span").text) | |
# if posts > total user posts, assume total posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_links(browser, tag, logger, media, element): | |
# Get image links in scope from tags | |
link_elems = element.find_elements_by_tag_name('a') | |
sleep(2) | |
links = [] | |
try: | |
if link_elems: | |
new_links = [link_elem.get_attribute('href') for link_elem in link_elems | |
if link_elem and link_elem.text in media] | |
links.extend(new_links) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""OS Modules environ method to get the setup vars from the Environment""" | |
import csv | |
import json | |
import logging | |
from math import ceil | |
import os | |
from datetime import datetime | |
from sys import maxsize | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Module only used to log the number of followers to a file""" | |
from datetime import datetime | |
from selenium.common.exceptions import WebDriverException | |
def log_follower_num(browser, username, logfolder): | |
"""Prints and logs the current number of followers to | |
a seperate file""" | |
browser.get('https://www.instagram.com/' + username) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import random | |
"""Module that handles the like features""" | |
from math import ceil | |
from re import findall | |
from selenium.webdriver.common.keys import Keys | |
from .time_util import sleep | |
from .util import update_activity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import choice | |
from .time_util import sleep | |
from .util import update_activity | |
from .util import add_user_to_blacklist | |
from selenium.common.exceptions import WebDriverException | |
import emoji | |
from selenium.webdriver.common.keys import Keys | |
def get_comment_input(browser): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_links_for_location(browser, | |
location, | |
amount, | |
logger, | |
media=None, | |
skip_top_posts=True): | |
"""Fetches the number of links specified | |
by amount and returns a list of links""" | |
if media is None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_active_users(browser, username, posts, boundary, logger): | |
"""Returns a list with usernames who liked the latest n posts""" | |
browser.get('https://www.instagram.com/' + username) | |
sleep(2) | |
total_posts = format_number(browser.find_element_by_xpath( | |
"//span[contains(@class,'_t98z6')]//span").text) | |
# if posts > total user posts, assume total posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build a dictionary containing the specified movie collection | |
movie_dict = { | |
'2005' : [('Munich', 'Steven Speilberg')], | |
'2006' : [('The Prestige', 'Christopher Nolan'), ('The Departed', 'Martin Scorsese')], | |
'2007' : [('Into the Wild', 'Sean Penn')], | |
'2008' : [('The Dark Knight', 'Christopher Nolan')], | |
'2009' : [('Mary and Max', 'Adam Elliot')], | |
'2010' : [('The King\'s Speech', 'Tom Hooper')], | |
'2011' : [('The Artist', 'Michel Hazanavicius'), ('The Help', 'Tate Taylor')], | |
'2012' : [('Argo', 'Ben Affleck')], |
OlderNewer