1
00:00:00,650 --> 00:00:01,010
Hi, there.

2
00:00:01,310 --> 00:00:08,210
Currently, we worked on accessing news on particular topics, not in this video, we're going to learn

3
00:00:08,210 --> 00:00:13,310
to access the current top headlines for a particular country.

4
00:00:14,060 --> 00:00:17,570
So what I'll do is I'll duplicate the previous codes.

5
00:00:25,400 --> 00:00:27,650
So that I don't have to write the codes again.

6
00:00:29,230 --> 00:00:31,060
Mostly, it will be like this.

7
00:00:31,480 --> 00:00:35,020
So we import requests, we have this function, gets news.

8
00:00:35,740 --> 00:00:43,390
But this time we're not going to have the topic parameter, nor from date, neither to date.

9
00:00:43,390 --> 00:00:44,770
So we remove those.

10
00:00:45,760 --> 00:00:49,440
This time what we have is country.

11
00:00:51,460 --> 00:00:59,980
We move the language parameter as well and just leave the country and the API key.

12
00:01:02,740 --> 00:01:03,460
Parameters.

13
00:01:05,710 --> 00:01:08,290
Either the euro will be a bit different this time.

14
00:01:08,560 --> 00:01:12,640
So HTP, as a newspaper, that's all curvy too.

15
00:01:13,180 --> 00:01:16,360
And then we have instead of everything.

16
00:01:17,600 --> 00:01:19,050
We have top.

17
00:01:21,530 --> 00:01:25,300
Headlines a question mark after that of.

18
00:01:26,690 --> 00:01:32,690
I'm going to remove all those until the apology.

19
00:01:32,870 --> 00:01:36,350
So after the headlines, we'll have country.

20
00:01:37,680 --> 00:01:46,830
Basically, to control our perimeter and then we have this and symbol, and then we have the API key,

21
00:01:46,830 --> 00:01:47,510
and that's it.

22
00:01:47,520 --> 00:01:54,930
That's the, you know, we gets a request object for that, you know, we get the contents, we access

23
00:01:54,930 --> 00:01:55,560
the articles.

24
00:01:55,800 --> 00:02:00,090
So the dictionary will be similar to the previous dictionary.

25
00:02:00,450 --> 00:02:03,810
So this dictionary also has a nautical ski.

26
00:02:04,590 --> 00:02:15,060
So we get the value of articles and we saw the results in a results variable using this loop in here.

27
00:02:17,220 --> 00:02:22,620
So that's the final coat on, then we want to call the function.

28
00:02:23,100 --> 00:02:29,160
So print gets news topic from date and two dates are all gone.

29
00:02:29,550 --> 00:02:35,630
So we have gone through a cycle to use the API keys of default parameters.

30
00:02:35,630 --> 00:02:38,490
So we leave it like that and we run the code.

31
00:02:40,630 --> 00:02:43,960
Those are the results, so these are the headlines.

32
00:02:46,100 --> 00:02:47,990
For USA Today.

33
00:02:49,530 --> 00:02:50,340
So thanks a lot.

34
00:02:50,580 --> 00:02:51,330
I'll see you later.

