Socket
Socket
Sign inDemoInstall

Naughty-and-Nice

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    Naughty-and-Nice

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.


Maintainers
1

Readme

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

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.

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc