Roommates always want to know what he is doing, I use Python to monitor his computer, the original

Source: Internet
Author: User
Tags sqlite database python script

(2) How do I send a message with an attachment?

A: Use Python's built-in email and smtplib two modules to construct and send messages

(3) How to automate these processes with Python?

A: Use shell scripts to connect these procedures and run them in a timed way using the crontab command.

Requirements

MacOS Sierra

Python3.6

Chrome

QQ email address for sending mail

QQ Email Authorization Code

SMTP Server address: smtp.qq.com

Email address to accept Mail

Code:

1. get_history.py

2. send_email.py

3. start.sh

4. Crontab-e

Python Source code:

send_mail.py

Get_history. Py

(2) get_history.py: With this Python script, we can extract the URL and access time and store it in

Result.txt, that's part of the result I got.

(3) send_email.py: With this Python script, we can send the result.txt as an attachment to the designated mailbox

Part of the results that I got

In this way, we execute the./start.sh in the terminal, and the system will help us execute the three statements in turn.

Note: Because the crontab command requires an absolute path, the path here is the absolute path

(5) Crontab: If you use this command, when the computer is turned on and networked, the system will automatically execute, and then send the results to your mailbox

A: This happens when we open the browser while visiting the history, there are two ways to solve this problem:

Path problem:

A: Everyone in the realization of the time, we should pay attention to the road to their own computer, and the mailbox related information to be changed to their own.

Summarize:

1. Use Python to connect to the SQLite database and perform SQL operations

2. Using Python to send mail

3. Use shell and crontab to establish automated routine tasks

4. It is wrong to look at other people's privacy, this article is just my own blind play, the practical feasibility is not strong

Prospect:

1. Package these into an executable file that can be deployed directly after double-clicking, and can cross-platform

2. At present, this script, only when the computer is open and networked, can automatically execute, so it is not ideal to monitor other people's browsing record Oh!

3. Finally wish everyone with the grass as tenacious, early on the peak of life

Roommates always want to know what he is doing, I use Python to monitor his computer, the original

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.