Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'us' is working but 'kr', 'jp', 'cn' .. are not working #93

Open
hwk06023 opened this issue May 10, 2024 · 2 comments
Open

'us' is working but 'kr', 'jp', 'cn' .. are not working #93

hwk06023 opened this issue May 10, 2024 · 2 comments

Comments

@hwk06023
Copy link

# US
head_lines = newsapi.get_top_headlines(category='entertainment', country='us')

for x in head_lines['articles']:
    print('title:', x['title'])
    print('description:', x['description'])    
    print('url:', x['url'])
    # print('urlToImage:', x['urlToImage'])
    print('content:', x['content'])
    print()

->

news_api


head_lines = newsapi.get_top_headlines(category='entertainment', country='kr') # or 'jp' or 'cn' ....

print(top_headlines)

for x in head_lines['articles']:
    print('title:', x['title'])
    print('description:', x['description'])    
    print('url:', x['url'])
    # print('urlToImage:', x['urlToImage'])
    print('content:', x['content'])
    print()

->

news_api_kr


Hi. In my case, 'us' is working but 'kr', 'jp', 'cn' .. are not working.
Is it not supported originally, or does there seem to be a problem?

Thank you.

@lukasfasnacht
Copy link

I've encountered the same problem. The modul supported all the country codes when I first implemented it. Seems like a new issue to me.

@one-littlebear
Copy link

Found the problem: the "get_top_headlines" function has "en" as default language. Just change it to "None" like the other params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants