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.
- Users can get top 5 news everyday with link on telegram
https://newsapi.org/
NA
This project is deployed on Railway Cloud currently
https://newsapi-production-04d6.up.railway.app/getNews
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
https://www.loom.com/share/7c7b23d81b76429f9855b5bce7ad02d0
Client: Java, SpringBoot,AppScript
Server: Embedded
If you have any feedback, please reach out to us at [email protected]