command line arguments

This commit is contained in:
Jidong Xiao
2023-11-28 14:55:43 -05:00
parent 136f9564c1
commit 18e22f9243

View File

@@ -44,18 +44,19 @@ Users can also decide to pause all notifications:
Your program will be run like this: Your program will be run like this:
```console ```console
nytrends.exe input.json output.txt hashtag nynotifications.exe posts.json users.json events.txt output.txt username
nytrends.exe input.json output.txt sound
``` ```
Here: Here:
- *nytrends.exe* is the executable file name. - *nynotifications.exe* is the executable file name.
- input.json contains data collected from TikTok. In this README we will refer to this file as **the json file**. - posts.json contains data collected from Instagram. Each line in this json file represents one post on Instagram.
- output.txt is where to print your output to. In this README we will refer to this file as **the output file**. - users.json contains data collected from Instagram as well as simulated data for users' notification preferences. Each line in this json file represents one user on Instagram.
- this field will be either hashtag or sound. When this field is *hashtag*, your program should display the top 10 trending hashtags to the output file. When this field is *sound*, your program should display the top 10 trending sounds to the output file. - events.txt defines all events which might trigger a notification. In this README we will refer to this file as the **events file**.
- output.txt is where to print your output to, and each line in this output file should represent one notification. In this README we will refer to this file as **the output file**.
- this argument would be a username. For each run of your program, **the output file** should contain notifications which are only supposed to be delivered to this user as specified by this **username**.
To summerize what your program does: your program reads data from **the json file**, analyze the data and find out the top 10 trending hashtags, or the top 10 trending sounds, and display them in the output file. To summerize what your program does: your program reads data from the two json files, and parse events from the events file. Based on the events and users' notification preferences, your program display notifications for this user (as specified in the **username** command line argument) in the output file.
## Format of input.json ## Format of input.json