Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 2.39 KB

Readme.md

File metadata and controls

66 lines (49 loc) · 2.39 KB

About this Project

This is an unofficial backend for News, utilizing NewsApi for fetching news. This project was developed as part of a Web Development vocational training Project.

Note

  • There's a seperate branch for Node, which can be accessed here

Folder Structure

# root
├── src/
│   ├── Fetch.php
│   ├── Helper.php
│   ├── logger.php
│   └── NewsAPI.php
└── index.php

Prerequisites

  • You need to install git or download using the zip method.

  • This is solely written in PHP, so it makes it obvious to have PHP installed.

  • There are two ways of having it installed:

    1. The Easy way using Xampp
    2. Using the Hard way is the official way

Steps to Deploy

If you using the git method:

  • Clone this Repository by using HTTP (or) SSH method.
    Example using HTTP method:
    git clone --depth=1 https://github.com/davinash97/newsapi

  • An API is needed from NewsApi for every requests.

  • The API key is supposed to be placed here. (It is purposely done so)

If you chose the EASY way:

  • Paste the newsapi directory inside xampp directory
    (Typically it's C:/xampp in Windows)
  • Look for htdocs folder and paste the newsapi folder there.
  • Now start the server from xampp control panel.
  • Open http://localhost:80
    • Point to note is port address i.e., 80 (in our case) can vary

If you chose the HARD way:

  • Now do cd newsapi to change the current directory.
  • Do php -S localhost:5500 to deploy and open the localhost:5500 in your preferred browser.

Supported Endpoints

  • Top Headlines: Can Provide with parameters like Keyword, Country or Category. Can also be used altogether to get specific result.

  • Everything: Can provide results with parameters like Keyword, Language, or searchIn category

It is limited to these for now, might add more in future versions (it's a "maybe" situation)

Updates

  • Feel free to improve or add features. Contributions in anyway possible are always welcome.