#100DaysOfWeb in Python Transcripts
Chapter: Days 77-80: Twitter and Slack bots
Lecture: Dependencies and outline script
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
Alright, time to write some code. But first, let's make a virtual environment. And I wanted to use Python 3.7 but tweepy throws an error
0:11
so I'm sticking with Python 3.6 for now which I have both installed on my system. Let me verify that.
0:28
And you see it takes the Python that's in my virtual environment. Now let's list the requirements in a requirements.text file.
0:45
Beautifulsoup, requests and TweetyPy and then I do a pip install -r requirements.txt
1:09
And let's make a Python script file tweet_100days.py. And we're going to do a couple of things. We're going to import all diaries.
1:26
We're going to load in the config with configparser. Then we're going to set the twitter key and secret
1:43
we're actually key secret and access token. We're going to define some constants
2:00
set up a logger and then we're going to complete three functions: get the date tweet;
2:20
twitter authenticate; and tweet status.
2:45
Then if this is executed as a script which is the main use we're going to put something on our main
2:56
and we're going to make, we did some hard parse here so we set up a command line interface that takes the -u of user
3:05
and the minus p of project command line switches and handles those. We're going to call these functions.
3:35
Alright, so this is more or less the skeleton. So let's go step-by-step. We're going to use quite some libraries in this lesson
3:52
And in the next video, we're going to import config information with the configparser module.