Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 2e1b38a

Browse files
committed
added screenshot future like feature. testing image pygui images.
1 parent 9d49295 commit 2e1b38a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

insta_upload.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
sys.path.append(r'C:\Users\eddyizm\Source\repo\twitterbot/')
1616
from post_image import tweet_photos, tweepy_creds, search_twtr, fave_tweet
1717
pyautogui.FAILSAFE = False
18-
# crontab for bash script:
19-
# 07 7 * * 1-7 export DISPLAY=:0; /home/eddyizm-hp/Documents/insta_delete/upload.sh >> /home/eddyizm-hp/HP/upload.log
2018

2119

2220
if os.name == 'nt':
2321
logintext = r'C:\Users\eddyizm\Desktop\Work\login.txt'
24-
firefoxPath= r'C:\Users\eddyizm\Source\Repos\InstaPy\assets\geckodriver.exe'
22+
firefoxPath= r'C:\Users\eddyizm\Source\Repos\seleniumTesting\env\geckodriver.exe'
2523
image_path = r'C:\Users\eddyizm\HP\images'
2624
desk_profile = r'C:\Users\eddyizm\AppData\Roaming\Mozilla\Firefox\Profiles\nljvmxt1.default'
2725
else:
@@ -52,8 +50,7 @@ def get_images(folder : str):
5250

5351

5452
def return_randomtime():
55-
#return randrange(25,60)
56-
return randrange(10,30)
53+
return randrange(25,60)
5754

5855

5956
def login_to_site():
@@ -111,15 +108,17 @@ def upload_image(browser_object : str, filepath : str):
111108
ActionChains(browser_object).move_to_element(options_button).click().perform()
112109
time.sleep(return_randomtime())
113110
print('selecting file on local file system')
111+
# browser_object.save_screenshot("selectingfile.png")
114112
pyautogui.write(filepath, interval=0.25)
115113
pyautogui.press('return')
116114
pyautogui.press('enter')
115+
# browser_object.save_screenshot("lookingforOpenBTN.png")
117116
btn = pyautogui.locateOnScreen('screenshots/open.png')
118117
if btn:
119118
top = (btn[0] + (btn[2]/2))
120119
bottom = (btn[1] + (btn[3]/2))
121120
pyautogui.click(x=top, y=bottom)
122-
print('file pushed to browser. now to resize and add the tags.')
121+
print('file pushed to browser... add the tags.')
123122
time.sleep(30)
124123
return browser_object
125124
except Exception as ex:
@@ -188,5 +187,5 @@ def main():
188187
continue
189188

190189
if __name__ == '__main__':
191-
# time.sleep(randrange(1,3000))
190+
time.sleep(randrange(1,3000))
192191
main()

screenshots/heart.png

542 Bytes
Loading

0 commit comments

Comments
 (0)