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.
- There's a seperate branch for Node, which can be accessed here
# root
├── src/
│ ├── Fetch.php
│ ├── Helper.php
│ ├── logger.php
│ └── NewsAPI.php
└── index.php
-
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:
- The Easy way using Xampp
- Using the Hard way is the official way
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)
- Paste the newsapi directory inside xampp directory
(Typically it'sC:/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
- 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.
-
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)
- Feel free to improve or add features. Contributions in anyway possible are always welcome.