GithubHelp home page GithubHelp logo

instantnews's Issues

Cant get past "open article in webbrowser"

Would you like to open an article in a web browser? Enter (y/n):
y
Traceback (most recent call last):
File "/home/nickb/.local/bin/instantnews", line 11, in
sys.exit(parser())
File "/home/nickb/.local/lib/python2.7/site-packages/instantnews.py", line 171, in parser
show_news(args.news, BASE_URL)
File "/home/nickb/.local/lib/python2.7/site-packages/instantnews.py", line 122, in show_news
choice = (input()).lower()
File "", line 1, in
NameError: name 'y' is not defined

Same happens if I enter a number.

KeyError: 'articles'

Hi! I install this package and be able to get codes/categories description, but when I try to run exact news-id, I get following error:

Traceback (most recent call last):
  File "c:\anaconda\envs\py353\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\anaconda\envs\py353\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Anaconda\envs\py353\Scripts\instantnews.exe\__main__.py", line 9, in <module>
  File "c:\anaconda\envs\py353\lib\site-packages\instantnews.py", line 162, in parser
    show_news(args.news,BASE_URL)   
  File "c:\anaconda\envs\py353\lib\site-packages\instantnews.py", line 95, in show_news
    for i in t['articles']:
KeyError: 'articles'

I get API key, running on Windows7/Python3.5.3/cmd

Need to add .gitignore

A .gitignore file should be added to ignore the build/ directory that is created when building locally.

Write unit tests

Unit tests should be written for this code. The user shouldn't have to manually test if everything still works after making a change in the code.

Unicode issues

There seem to be some unicode issues on certain characters within the feeds. I'm seeing this error on almost every news site:

» in -n techcrunch
Traceback (most recent call last):
  File "/usr/local/bin/instantnews", line 11, in <module>
    sys.exit(parser())
  File "/Library/Python/2.7/site-packages/instantnews.py", line 171, in parser
    show_news(args.news, BASE_URL)
  File "/Library/Python/2.7/site-packages/instantnews.py", line 114, in show_news
    print('[{0}] {1}: {2}'.format(len(article_list), "Title", article['title']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 43: ordinal not in range(128)
» in -n cnbc
[0] Title: Trump says Michael Flynn's actions during transition were 'lawful' and 'there was nothing to hide'
Author: Javier E. David
Summary: President Donald Trump said he fired former national security advisor Michael Flynn for lying, but his actions were "lawful."
--------------------------------------------
[1] Title: Strategist Jim Paulsen says prepare for a stock market correction in 2018
Author: Trent Gillies
Summary: Jim Paulsen, Leuthold Group's chief investment strategist, says its time for investors to rebalance their 401(k)s since a market correction is coming soon.
--------------------------------------------
[2] Title: Even a $1 million retirement nest egg isn't enough anymore
Author: Jessica Dickler
Traceback (most recent call last):
  File "/usr/local/bin/instantnews", line 11, in <module>
    sys.exit(parser())
  File "/Library/Python/2.7/site-packages/instantnews.py", line 171, in parser
    show_news(args.news, BASE_URL)
  File "/Library/Python/2.7/site-packages/instantnews.py", line 116, in show_news
    print('{0}: {1}'.format("Summary", article['description']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 102: ordinal not in range(128)

» in -n bloomberg
[0] Title: Trump Says He's `Unbeatable' in 2020 on Tax Cuts, Stock Market
Author: Jennifer Jacobs
Traceback (most recent call last):
  File "/usr/local/bin/instantnews", line 11, in <module>
    sys.exit(parser())
  File "/Library/Python/2.7/site-packages/instantnews.py", line 171, in parser
    show_news(args.news, BASE_URL)
  File "/Library/Python/2.7/site-packages/instantnews.py", line 116, in show_news
    print('{0}: {1}'.format("Summary", article['description']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 197: ordinal not in range(128)

installed via pip

jq error

Just installed this in Arch Linux and am getting the issue shown in the capture
jq error

README needs to be updated

In the README, the user is instructed to create an environment variable for the API key called "IN_API_TOKEN". The code checks for an environment variable called "IN_API_KEY". The README should be updated to display the correct environment variable name.

Usage examples could also be reformatted for readability.

Reformatting of code

The code could be reformatted for readability. Updates could include uniform line spacing and improved Pydoc comments for the functions.

The messages displayed to the user throughout the program could also be updated to be a little more clear and intuitive.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.