Skip to content

Commit 34fa543

Browse files
committed
few edits
1 parent a191ed2 commit 34fa543

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

TwitterParsing/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ cd $APPDIR
99
source /Users/alexandreattia/Desktop/Work/workenv/bin/activate
1010

1111
# launch python script
12-
./download_pics.py
12+
./send_pictures.py

TwitterParsing/send_pictures.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import matplotlib.pyplot as plt
2-
import cv2
31
import glob
42
import numpy as np
53
from email.mime.text import MIMEText
@@ -9,13 +7,16 @@
97
from email.utils import formataddr
108
import smtplib
119
import config_downl
10+
from download_pics import internet_on
11+
import datetime
12+
import sys
1213

1314
def get_picture():
14-
pic_folder = '/Users/alexandreattia/Desktop/Work/machine_learning_flashcards_v1.4/png_web/'
15-
pics = glob.glob(pic_folder + '*')
16-
pic = np.random.choice(pics)
17-
flashcard_title = pic.split('/')[7].replace('_web.png', '').replace('_', ' ')
18-
return pic, flashcard_title
15+
pic_folder = '/Users/alexandreattia/Desktop/Work/machine_learning_flashcards_v1.4/png_web/'
16+
pics = glob.glob(pic_folder + '*')
17+
pic = np.random.choice(pics)
18+
flashcard_title = pic.split('/')[7].replace('_web.png', '').replace('_', ' ')
19+
return pic, flashcard_title
1920

2021
def send_email(flashcard_title, pic):
2122
"""
@@ -64,5 +65,5 @@ def send_email(flashcard_title, pic):
6465
if time_slept > 15 :
6566
print('%s - No network connection' % datetime.datetime.now().strftime('%d/%m/%Y - %H:%M'))
6667
sys.exit()
67-
p, fc = get_picture()
68-
send_email(fc, p)
68+
p, fc = get_picture()
69+
send_email(fc, p)

0 commit comments

Comments
 (0)