This is a simple automation that tweets the title and the link of a channels latest video when uploaded along with tags.
Use the package manager pip
To install google-api-python-client
python3 -m pip install -U google-api-python-client
To install tweepy
pip install tweepy
This is a simple autmation that helps to understand how API works and how to use them on a real life example.
-
Create a
python
virtual environment. -
Clone the repo
git clone https://github.com/DivyaKumarBaid/Youtube_promotion_on_twitter.git
or download the repository. -
Go to the cloned/downloaded directory
cd Youtube_promotion_on_twitter
-
Create a project on google cloud console and enable youtube API V3
-
Copy the
API Acess Key
of the API and paste it in theapi_key
under youtube api in main.py file -
If you have a developer account in twitter then create or generate the api keys (consumer_key,consumer_key_secert,access_key,access_key_secret)
If you dont have the developers account then you have to apply for it, it will take a day or two to be approved
-
You have to get the youtube channel Id you want to promote (you will get it from the https link e.g.https://www.youtube.com/channel/CHANNEL_ID )
-
Run it.
To minimise the calling to youtube API as it has low quota, I have set the interval between any call of youtube api to be 1hr. However you can change it as you like.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.