Skip to content

lodenrogue/news

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

News

Get headline news from popular news sources

Get headlines

headlines = News().get_headlines()

for headline in headlines:
    # Source name, ABC, CNN, etc
    headline.source
    
    headline.article.title

    # First 200 characters of the article
    headline.article.snippet

    headline.article.url

Get articles from specified source

count = 3
articles = News().get_from_source("cnn", count)

for article in articles:
    article.title
    article.snippet
    article.url

Using the commandline interface

# Get headlines
python news.py

# Get from specified source
python news.py -s "bbc"

# Get from source with count
python news.py -s "npr" -c 3

Available Sources

  • ABC
  • BBC
  • CNN
  • NPR

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published