Git Product home page Git Product logo

unixporn-top-tags's Introduction

๐Ÿ“Š r/unixporn Top Tags

This script is designed to analyze and aggregate the tags used in post titles on the /r/unixporn subreddit. It fetches posts from Reddit, extracts tags from post titles, normalizes them, and then counts their occurrences, outputting the result in a CSV file

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.x
  • PRAW (Python Reddit API Wrapper)
  • Pandas
  • NumPy
  • Matplotlib
  • python-dotenv

Installation

  1. Clone the repository or download the source code.
  2. Install the required Python packages:
    pip install -r requirements.txt
  3. Set up your Reddit API credentials (see the "Configuration" section below).

Configuration

You need to create a Reddit API application to get your client_id and client_secret. Follow these steps:

  1. Go to Reddit's apps page.
  2. Click "Create App" or "Create Another App".
  3. Fill in the details:
    • Name: Whatever you prefer
    • App type: Choose "script"
    • Description: Optional
    • About URL: Optional
    • Redirect URI: http://localhost:8080 (or another URI of your choice)
  4. Click "Create app".
  5. Note down the client_id (under the app name) and client_secret.

Create a file named .env in the same directory as the script with the following contents:

CLIENT_ID=your_client_id_here
CLIENT_SECRET=your_client_secret_here

๐Ÿ“ Usage

Create the data

Run the script using Python:

python tag_counter.py

The script will fetch data from the subreddit, process it, and output the results in a file named tag_counts.csv.

Create graph from the data

Run the script using Python:

python tag_counter.py

This script will create a horizontal bar graph from the resulting data.

๐Ÿ“š Features

  • Fetches top posts from /r/unixporn for each year since the subreddit's creation.
  • Extracts and normalizes tags from post titles.
  • Counts the occurrence of each tag.
  • Outputs the result in a CSV file for easy analysis.
  • Create a graph from the resulting CSV file.

โš™๏ธ Customization

You can customize the script to analyze different subreddits or to change the normalization rules by editing the normalize_tag function.

๐Ÿ“‹ License

This project is open source and available under the GNU GPLv3.

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

๐ŸŒŸ Acknowledgements

Special thanks to the Reddit community and the developers of PRAW for making this project possible.

๐Ÿ“ˆ A graph from January 2024

unixporn-top-tags's People

Contributors

dybdeskarphet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.