This project is part of the ALX School curriculum focusing on API usage and Python scripting. The goal is to practice working with the Reddit API, querying various endpoints, and performing tasks such as retrieving subscriber counts, fetching top posts, and analyzing post titles for specific keywords.
The project consists of several tasks, each targeting different aspects of API interaction and Python programming. Below are the tasks included in this project:
-
Number of Subscribers: Write a function to query the Reddit API and return the number of subscribers for a given subreddit.
-
Top Ten: Write a function to retrieve and print the titles of the top ten hot posts for a given subreddit.
-
Recurse It!: Implement a recursive function to fetch the titles of all hot articles for a given subreddit.
-
Count It!: Develop a recursive function to parse hot article titles and print a sorted count of specified keywords.
APIs are essential for modern software development, and understanding how to interact with them efficiently is crucial. This project provides practical experience in querying APIs, handling pagination, parsing JSON responses, and implementing recursive functions.
Upon completing this project, you should be able to:
- Read API documentation to identify endpoints
- Utilize pagination when working with APIs
- Parse JSON responses from APIs
- Implement recursive functions for API calls
- Sort dictionaries by value
- Allowed editors: vi, vim, emacs
- Code will be interpreted/compiled on Ubuntu 20.04 LTS using Python 3.4.3
- Use PEP 8 style for coding conventions
- All files must end with a new line and start with
#!/usr/bin/python3
- Libraries should be alphabetically organized
- Include a README.md file at the root of the project folder
- Ensure all code files are executable
- Write documentation for all modules
- Utilize the Requests module for HTTP requests to the Reddit API
- Solutions should be original and meet the learning objectives.
- Plagiarism is strictly prohibited and will result in removal from the program.
- Content from this project should not be published.
- GitHub Repository: alx-system_engineering-devops
- Directory: 0x16-api_advanced
Each task has a corresponding Python file in the repository. You can execute the main files with appropriate arguments to test the functionality.
Example usage:
python3 0-main.py programming
The numbers and results presented in the examples may not be accurate due to the dynamic nature of Reddit's content.
ALX School, 2024