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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file Naughty and Nice-7.7.1.tar.gz.

File metadata

  • Download URL: Naughty and Nice-7.7.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.0 CPython/3.5.3

File hashes

Hashes for Naughty and Nice-7.7.1.tar.gz
Algorithm Hash digest
SHA256 026ede42b867b996a76bd358177b9b6292de6d8c3692de346fa4b6e6ff9ca6e4
MD5 139e2827facd6f3872d4f5f23b30c197
BLAKE2b-256 2556a5acc0e6a51a2c2379b98f3aafc7a6832f6c3e909b9a774b0804d400cb20

See more details on using hashes here.

File details

Details for the file Naughty_and_Nice-7.7.1-py3-none-any.whl.

File metadata

  • Download URL: Naughty_and_Nice-7.7.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.0 CPython/3.5.3

File hashes

Hashes for Naughty_and_Nice-7.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2af8a23f39686041488b73a45771791614c9dd8655dbaf29494b010ab8048dd6
MD5 8a5a3b9e5ac4645d7a00db23822c4170
BLAKE2b-256 bd102c3ef08715530d1aacdbc4832a957ea328c21bb71bd4cada76212ded64d3

See more details on using hashes here.

Supported by

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