This application is designed to monitor a chosen subreddit.
-
Clone the repository:
git clone [email protected]:marcelluseasley/redditracker.git
-
To build the application, run the following command:
make build
This will compile source code and create a binary named
redditracker
in thecmd/redditracker
directory. -
To remove the binary, run the following command:
make clean
- Configure the API Token in a
.env
file (you will need to create it, since its in.gitignore
):- Navigate to
cmd/redditracker/.env
.
REDDIT_CLIENT_ID='' REDDIT_CLIENT_SECRET='' USER_AGENT=''
- Navigate to
To run the application, use the following command:
make run PORT=8080 SUBREDDIT=TaylorSwift
This will run the redditracker
binary with the specified port and subreddit. You can replace 8080
and TaylorSwift
with the port number and subreddit you want to track.
Once the application is running, it will begin monitoring the specified subreddit. The statistics will be reported by navigating to (fill in your port):
http://localhost:[PORT]/
You can also make a curl request to get a JSON response of results. The query parameter q
is required and takes one of: all
, posts
, or users
:
curl --location 'http://localhost:[PORT]/data?q=[all,posts,users]'
This project is licensed under the MIT License.
- Reddit API for providing the data used by this application.