Twitter authentication using Tweepy API and can Post and see HomeTimeline tweets using Django.
Extending the concept of our Curse-Word-Detection-For-Twitter repository you can see the homeline tweets and can post tweets.
pip install tweepy
pip install Django==1.9
pip install profanityfilter
Generate your Twitter Credential if you dont have one from Twitter Application Manager, And Set the Callback URLs in Settings of Twitter Application Manager to
- Clone the repository
git clone https://github.com/Tirth27/Tweepy-Oauth-in-Django-.git
-
Generate your CONSUMER_KEY and CONSUMER_SECRET form Twitter Application Manager found under Keys and Access Tokens section. And paste the CONSUMER_KEY and CONSUMER_SECRET in util.py
-
Run the django server on localhost
python manage.py runserver
Clicking on Sign in with Twitter will take you to twitter authentication page to authorize app
Once you have authorize you app it will redirect you Info page on your localhost
Clicking on Goto to Timeline will fetch your Hometimeline tweets
Clicking on Goto to Post will take you to post_tweet page where you can post tweets.
Here we have apply the Profanity-Filter which does not allow user to use profane words in the tweet. If user tries to use the profane words in the tweet, it won't allow user to post the tweet on twitter and shows Explicit Contect detected ! Please try again. error message.
-
Rather then using the Profanity-Filter use the Natural Language Processing to detect Explicit or Profane words in tweets.
-
Display the HomeTimeline tweets in more readable way with the user name, user profile image and user tweets
-
Perform the Sentiment Analysis on each tweets using TextBlob. The label should be either 'Positive' or 'Negative'. You can define the sentiment polarity threshold yourself, whatever you think constitutes a tweet being positive/negative. And display tweets with its polarity in the HomeTimeline page.
The credit for this project goes to @github/Tirth27 and @github/PatrioticParth