Flow:
- The user profile from twitter is extracted and given as a input to personality insight to analyse.
- as per traits, on the basis of likelyness we need to fetch the playlist from youtube
- return back the playlist to user.
Setup steps:-
- Python 2.7 must be installed, python --version
- PIP must be installed
- Flask must be installed, pip install Flask
- Extract the project code
- run following command:- pip install --upgrade google-api-python-client python-gflags oauth2client==1.4.12 google-auth google-auth-oauthlib google-auth-httplib2
6.run FLASK_APP=index.py flask run 7. Add client-secret.json 8. In index.py, add your API key
Project keys configuration:-
- Goto https://console.cloud.google.com/home/dashboard & signup using your google account
- click on my project
- A project will be created and opened
- Go to API & service page > credentials
- You need to create a API and OAuth2.0 Id
- first generate api key
- For Oauth > select other and download client-secret.json
API Reference:-
- localhost:5000/getPreferenceMusic - Get Videos as per genre's (Preferences JSON, only score > 0 )
- localhost:5000/createPlaylistFromPreferences (Fetch videos as per genre's and create a playlist and add those fetched videos into playlist)
- localhost:5000/getMyPreferencePlaylist - Get list of Playlist of user with matching genre's from Preferences JSON with score > 0
- localhost:5000/deleteMyPreferencePlaylist - Delete Preference Playlist