{"size": 808, "ext": "js", "max_stars_repo_path": "jsonreaderbot.js", "max_stars_repo_name": "ducbo/jsonreaderbot", "max_stars_repo_stars_event_min_datetime": "2017-08-04T20:41:47.000Z", "max_stars_repo_stars_event_max_datetime": "2017-08-06T20:15:26.000Z", "max_issues_repo_path": "jsonreaderbot.js", "max_issues_repo_name": "ducbo/jsonreaderbot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "jsonreaderbot.js", "max_forks_repo_name": "ducbo/jsonreaderbot", "max_forks_repo_forks_event_min_datetime": "2017-08-06T04:17:22.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-19T18:53:40.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 4, "avg_line_length": 21.2631578947, "max_line_length": 147, "alphanum_fraction": 0.6596534653}
require('dotenv').config()
const TeleBot = require('telebot');
const bot = new TeleBot(process.env.BOT_TOKEN);

var request = require("request");
var options = { method: 'GET',
  url: 'https://newsapi.org/v1/articles',
  qs: 
   { source: 'bbc-news',
	 sortBy: 'top',
     apiKey: process.env.NEWSAPI },
   json: true};


	
	bot.start();

request(options, function (error, response, body) {
  if (error) throw new Error(error);
  
  var source = body.source
  var title = body.articles[0].title
  var urlToImage = body.articles[0].urlToImage
  var url =  body.articles[0].url
  var summary = body.articles[0].description
  console.log(body);
  
  bot.sendMessage(-242559392, '<b>${title}</b>+${summary}+${url}' , {parseMode: 'html', disable_web_page_preview: false , webPreview: urlToImage});
  

});




	

