Skip to content

Latest commit

 

History

History

0x16-api_advanced

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Reddit API Project

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.

Overview

The project consists of several tasks, each targeting different aspects of API interaction and Python programming. Below are the tasks included in this project:

  1. Number of Subscribers: Write a function to query the Reddit API and return the number of subscribers for a given subreddit.

  2. Top Ten: Write a function to retrieve and print the titles of the top ten hot posts for a given subreddit.

  3. Recurse It!: Implement a recursive function to fetch the titles of all hot articles for a given subreddit.

  4. Count It!: Develop a recursive function to parse hot article titles and print a sorted count of specified keywords.

Background Context

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.

Learning Objectives

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

Requirements

  • 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

Copyright and Plagiarism

  • 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.

Repository Information

Usage

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

Disclaimer

The numbers and results presented in the examples may not be accurate due to the dynamic nature of Reddit's content.

Author

ALX School, 2024