Skip to main content

A program that gets tweets off your API key in tweepy and analyizes a user's acount on twitter to see if they are naughty or nice.

Project description

Before you analyze people's twitter accounts, you need to get a twiiter API key and you are also going to need to import other stuff for this to work!
Make a register/login at https://twitter.com/ then got to https://apps.twitter.com/ and click the "Create a New App" button so you can make a new app. Put all
the details in, like the name and the description for your app, but don't worry about the website. Just put a random domain, but change it later! After you
create your App, go to the "Keys and Access Tokens" tab and you will see your API key(Consumer Key) and API secret(Consumer Secret), but you will need 2 more
things. You will need your access token and your access token secret. Generate both of them by clicking the "Create My Access Token" button to create you access
token. Don't ever share you API keys and Access Tokens. If you accidently share your access tokens, just press regenerate access tokens. Open up a file on a Text
Editor like LeafPad or Notepad. Save the file as "twitter_auth.json". The file should look like this:

{
"consumer_key": "YOUR-API-KEY-OR-CONSUMER-KEY",
"consumer_secret": "YOUR-API-SECRET-OR-CONSUMER-SECRET",
"access_token": "YOUR-ACCESS-TOKEN",
"access_token_secret": "YOUR-ACCESS-TOKEN-SECRET"
}

Copy and paste it, but put your credentials in the quotes "".

That's it for the twitter setup.
Next is the coding for the sentiment analysis.
If you haven't installed Python, then you should install it!.
After you install Python, go to the Command Prompt/Terminal. Type in the command prompt "pip install -vvv Naughty-and-Nice".
Then do the same command 1 more time so the terminal/command prompt gives this response:

Requirement already satisfied: Naughty-and-Nice in <wherever the path of the file is in. Keep track of this path>

On the terminal, type in "pip3 install Naughty-and-Nice". After you install Naughty-and-Nice, using the same process "pip install" or "pip3 install", install
2 more things. NLTK and Tweepy. "pip/pip3 install nltk" and "pip/pip3 install tweepy". Then make a new file called "nltk_download.py" and type in:

import nltk
nltk.download()

Run the code and you will see a window pop up called NLTK downloader after the python run window pops up. Double click on "all packages" to install all the
packages.

Go to the path of the Naughty and Nice file you saw earlier by going to a file manager. Do a search for naughty_and_nice and it should show up.
Don't run the code. If you do, you will see a error pop up. Go to the ##SET UP TWITTER comment and look below it. You will see 3 things below it. The with open
and the ## Or On Windows ## and two lines below that, another with open. If you are on Linux or MacOS then use the first with open. If you are on windows,
use the second with open AND take out the # right at the start of the with open. Then type in the path of your "twitter_auth.json" file. Then you can run it.
If a error pops up, then make sure your credentials are correct and your path. Then the system should run properly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Naughty and Nice-7.7.1.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

Naughty_and_Nice-7.7.1-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page