Skip to content

Consumes NewsAPI and returns JSON input and then using AppScript provides us top 5 news everyday .

Notifications You must be signed in to change notification settings

subhajit51193/NewsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

News APP

This is a very basic test application. It consumes news api from https://newsapi.org/ and returns json values for the client end. Then by using AppScript it calls the api everyday at the same time so that user can get top 5 news details on their Telegram by a bot.

Features

  • Users can get top 5 news everyday with link on telegram

API Reference

  https://newsapi.org/

Optimizations

NA

Deployment

This project is deployed on Railway Cloud currently

  https://newsapi-production-04d6.up.railway.app/getNews

Installation

Install main file after that create new google sheet and link AppScript with below code so that we can get all the news API in google sheet.

  function myFunction() {
  var url = "https://newsapi-production-04d6.up.railway.app/getNews";
  var response = UrlFetchApp.fetch(url);
  var json = response.getContentText();
  var apidata = JSON.parse(json);
  

  var cursheet = SpreadsheetApp.getActiveSheet();
  cursheet.clear();
  var headerRow = ['author','title','description','url','urlToImage','publishedAt','content'];
  cursheet.appendRow(headerRow);

  for (var i=0;i<5;i++){
     var row = [apidata.articles[i].author,apidata.articles[i].title,apidata.articles[i].description,apidata.articles[i].url,apidata.articles[i].urlToImage,apidata.articles[i].publishedAt,apidata.articles[i].content];
     SpreadsheetApp.getActiveSheet().appendRow(row);
  }
  
}

Now we have the API for top 5 news. No we can create new bot and channel from Telegram and share all the news with members. My Ref- https://www.youtube.com/watch?v=ovYHbxe4E5w

Demo

https://www.loom.com/share/7c7b23d81b76429f9855b5bce7ad02d0

Tech Stack

Client: Java, SpringBoot,AppScript

Server: Embedded

Authors

Feedback

If you have any feedback, please reach out to us at [email protected]

🔗 Links

portfolio linkedin

About

Consumes NewsAPI and returns JSON input and then using AppScript provides us top 5 news everyday .

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages