Automatically adds a movie's rating, genre, type, imdb-link, plot, and an emoji to an entry in a Notion database based on the Title.
- About the Project
- Notion prerequisites
- Getting started
- Getting started using Docker
- Development setup
- Contributing
- License
- Acknowledgements
We made this tool since we are lazy and did not want to, manually, add a lot of information about each and every movie that we added to our movie watchlist that we have in Notion. Since both of us being programmers, the solution for this lazy-problem was a nobrainer. Lets create a python-application that does this for us!
This python application is listening to changes to our movie watchlist database. When adding a new movie, application automatically fetches the information about the movie from imdb and populates the properties, adds the plot as the content, and an appripriate emoji for that particluar database entry.
There is some things you have to setup in / acquire from Notion before we can get started.
Open your web browser and navigate to Notion. Once the page is loaded, press F12
. You should now see the developer console open up. Press the top navigation Application
. In this section you should see a bunch of things to the left. One of which says Cookies
under Storage
, press the Notion cookie and then locate the token_v2
cookie. The following picture shows how it look like in Chrome.
Copy the value of this token and add it to the .env_example
file.
Open your web browser and navigate to Notion. Once the page is loaded, navigate to your database page and simpyl copy the url.
Copy the value of this token and add it to the .env_example
file.
Rename the .env_exampel
to just .env
$ mv .env_example .env
Note: Do not add any whitespace around the =
sign in the .env
file.
Make sure that the movie watchlist has the right properties. Add the following to the database:
- imdb (url), this will be populated by the imdb url
- Genre (multi-select), self explanatory
- Rating (number), also self explanatory
- Type (mult-select), what type it is (
movie
/series
/mini series
)
To get the application to run locally, follow these simple steps. The application is running inside a python virtual environment for simplicity reasons and amongs other things it makes dealing with package dependencies easier.
If you wanna run the application inside a docker container, jump to Getting started using Docker
In order to run this application you have to have the following things installed on your computer.
- python3.8
- pipenv
The following command will install everything for you, if you have a system that does not support this command. A quick google will help you getting these packages installed
$ sudo apt install python3.8 python3-pip
Now, if you are a user that simply want to run this application and have it populate database entries in Notion with information from IMDB.
If you are a developer and would like to run and continue development on the application, continue to Development setup
Setup the python environment and install the necessary dependencies
pipenv install
If you just want to run this program and have it working out of the box in a matter of minutes. Docker is the way to go. You still have to do the step regarding the acquiring of the Notion token and database url though. Notion prerequisites
- Docker, you can read more about how to install it here.
Build the docker image
$ docker build -t imdb-notion .
This will start the container and then run the application.
$ docker run imdb-notion
Done, go ahead and try to add a movie to your movie list and watch as the python applcation adds the relevant information to the entry.
In case you want to keep developing on the project you also have to install the packages that are necessary for development.
pipenv install --dev
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/amazing-feature
) - Commit your Changes (
git commit -m 'Adds amazing-feature'
) - Push to the Branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.