shivam043 / instantnews Goto Github PK
View Code? Open in Web Editor NEWGet live news instantly :newspaper:
License: MIT License
Get live news instantly :newspaper:
License: MIT License
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.
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
A .gitignore file should be added to ignore the build/ directory that is created when building locally.
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.
setup.py uses distutils which doesn't support install_requires.
Replace
from distutils.core import setup
with
from setuptools import setup
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
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.
All apostrophes in the text pulled from the API show up as rectangles.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.