Coder Social home page Coder Social logo

pic16a-twitter-api's Introduction

PIC16A-Twitter-API

Made by Melina Diaz, Tracy Charles, Michelle Pang

Note: We provided a uclatweets.csv in case someone wanted to use functions from analysis.py but didn't have a bearer_token in order to run make_call(...) from making_dataframe which makes a CSV

  1. Project name: UCLA's Twitter API Project
  2. Names of group members (if you don’t want to for privacy, add usernames): Melina Diaz, Tracy Charles, Michelle Pang
  3. Short description of the project: Using the Twitter API, we made a dataframe of tweets about UCLA and made inferences about the tweets using clusters and sentiment analysis to determine what is currently trending around UCLA and if the general consensus are positive or negative. Additionally, the Twitter API allows us to extract more details about the original tweet such as the number of retweets, followers and likes which hints to the credibility and influence of the tweet.
  4. Instructions on how to install the package requirements. Firstly, clone the repository and use conda create --name NEWENV --file requirements.txt to download packages used in 'making_dataframe.py' and 'analysis.py' files. Then, open the 'demo.ipynb' file and run all codes to generate the results as shown in the next point.
  5. Detailed description of the demo file (how to run it, what output one should expect to see, and explanations of result): demo.ipynb is the end-to-end demo.
  • The first cell imports making_dataframe.py and analysis.py
  • Second cell creates a dataframe by calling the API with your bearer token and a keyword. It creates a JSON and CSV file named filename that has max_results number of tweets (or less if not enough are available).
  • Third cell will create an obj of our custom class. We created 3 functions which will output recent tweets with the highest popularity scores, topic clusters, and a bar graph and word clouds from the sentiment and words used in tweets. This can be seen in cells 5, 6, 7. Note that the outputs will depend on the dataset, and the dataset changes based on the most recent tweets. The word cloud function also generates different word clouds each run, so it is expected for every user to get different outputs. Here are the examples of the four visualizations. image image image image
  • Cells 8, 9, 10 are showing the use of exceptions. The exceptions allow the code to run properly without being halted by errors.
  1. Scope and limitations, including ethical implications, accessibility concerns, and ideas for potential extensions: Although this package is publicly available, users who wish to access the tweets will require a Bearer Token that can be created through the Twitter API developer portal. Some possible extensions include any topic that preferably has a lot of public consensus such as public figures, politics, weather conditions etc.
  2. License and terms of use (probably MIT license). We obtained the dataset using the Twitter API. The Twitter Development Agreement and Policy can be found here: https://developer.twitter.com/en/developer-terms/agreement-and-policy. Our code is reproducible and open to the general public.
  3. References and acknowledgement: Twitter API developer platform
  4. Background and source of the dataset: We generated this dataset, which consists of the most recent tweets about UCLA
  5. Links to any tutorials you used, and at least 3 specific things you implemented that differentiates your project from what’s already in the tutorial:

pic16a-twitter-api's People

Contributors

melina-diaz avatar michellepang-01 avatar tracycharles108 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

tracycharles108

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.