sukeesh / Jarvis

Personal Assistant for Linux and macOS
MIT License
3.02k stars 1.04k forks source link

Bugs in news plugin #446

Closed madhavkulkarni1986 closed 5 years ago

madhavkulkarni1986 commented 5 years ago

News plugin:

Traceback (most recent call last): File "/home/madhav/Projects/Jarvis/jarviscli/CmdInterpreter.py", line 151, in try_do do(self, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 219, in _plugin_run_with_network_error run_func(jarvis, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 201, in run self._backend[0](jarvis.get_api(), s) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 47, in call self.parse_articles(self.get_headlines(jarvis), jarvis) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 144, in get_headlines url = "https://newsapi.org/v2/top-headlines?country=us&apiKey=" + self.get_api_key(jarvis) TypeError: Can't convert 'NoneType' object to str implicitly

~> What can i do for you?


0 Some error occurred, please open an issue on github! Here is error:

Traceback (most recent call last): File "/home/madhav/Projects/Jarvis/jarviscli/CmdInterpreter.py", line 151, in try_do do(self, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 219, in _plugin_run_with_network_error run_func(jarvis, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 201, in run self._backend[0](jarvis.get_api(), s) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 50, in call self.parse_articles(self.get_headlines(jarvis), jarvis) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 214, in parse_articles jarvis.say(article_list[int(idx)]['description']) KeyError: 0

~> What can i do for you? news 1: Giuliani: Mueller report line about not exonerating Trump is a 'cheap shot' - CNN 2: Physician groups call for taxes and regulations on kids' access to sugary drinks - KSL.com 3: NASA study shows melting glacier miraculously growing again - AccuWeather.com 4: Michael Avenatti arrested on federal charges of wire fraud and extortion — live updates today - CBS News 5: NASA Cancels First All-Female Spacewalk Over Spacesuit Sizes - The New York Times 6: How A Tesla Can Save You Thousands Of Dollars - CleanTechnica 7: Women are diagnosed years later than men for same diseases, study finds - NBCNews.com 8: Schumer rails against 'ancient poison' of anti-Semitism in AIPAC remarks - Fox News 9: All the things Apple didn’t tell us about its streaming TV service - The Verge 10: Suspect in killing of Mafia boss was influenced by right-wing hate speech, lawyer says - NBC News 11: Newtown dad who probed violence dies in apparent suicide - Fox News 12: N.J. won't be getting legal weed soon. Here's what went wrong. - lehighvalleylive.com 13: ‘I was not warned’ - Women who say they were sickened by breast implants demand FDA action - Washington Post 14: McDonald’s is acquiring Dynamic Yield to create a more customized drive-thru - TechCrunch 15: 'Sneaker Shopping' with Lupita Nyong'o and Winston Duke - Sole Collector 16: Why Israel is so good at targeting Hamas - Washington Examiner 17: Column: NASCAR schedule may not be the overhaul fans sought - Associated Press 18: Trump was right to recognize Israel's claim to the Golan Heights - Washington Examiner 19: Parkland, Fla., Struggles To Respond To Two Recent High School Suicides - NPR 20: Matter waves and quantum splinters - Phys.org Powered by News API. Type NewsAPI to learn more Type index to expand news

21 Some error occurred, please open an issue on github! Here is error:

Traceback (most recent call last): File "/home/madhav/Projects/Jarvis/jarviscli/CmdInterpreter.py", line 151, in try_do do(self, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 219, in _plugin_run_with_network_error run_func(jarvis, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 201, in run self._backend[0](jarvis.get_api(), s) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 50, in call self.parse_articles(self.get_headlines(jarvis), jarvis) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 214, in parse_articles jarvis.say(article_list[int(idx)]['description']) KeyError: 21

~> What can i do for you?



Traceback (most recent call last): File "/home/madhav/Projects/Jarvis/jarviscli/CmdInterpreter.py", line 151, in try_do do(self, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 219, in _plugin_run_with_network_error run_func(jarvis, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 201, in run self._backend[0](jarvis.get_api(), s) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 50, in call self.parse_articles(self.get_headlines(jarvis), jarvis) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 153, in get_headlines return self._get(url) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 176, in _get response = urllib.request.urlopen(url) File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.5/urllib/request.py", line 472, in open response = meth(req, response) File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.5/urllib/request.py", line 510, in error return self._call_chain(args) File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(args) File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 400: Bad Request

~> What can i do for you? news configure 2: financial-times 9: the-new-york-times 11: fox-news 12: cnn 1: bloomberg 13: google-news 5: al-jazeera-english 6: the-wall-street-journal 3: cnbc 4: reuters 10: abc-news 14: wired 7: the-huffington-post 8: business-insider Type the indexes of the sources you would like to add to your channel separated by space: 15 15 has been successfully been added to your sources! ~> What can i do for you? news Some error occurred, please open an issue on github! Here is error:

Traceback (most recent call last): File "/home/madhav/Projects/Jarvis/jarviscli/CmdInterpreter.py", line 151, in try_do do(self, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 219, in _plugin_run_with_network_error run_func(jarvis, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 201, in run self._backend[0](jarvis.get_api(), s) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 50, in call self.parse_articles(self.get_headlines(jarvis), jarvis) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 153, in get_headlines return self._get(url) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 176, in _get response = urllib.request.urlopen(url) File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.5/urllib/request.py", line 472, in open response = meth(req, response) File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.5/urllib/request.py", line 510, in error return self._call_chain(args) File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(args) File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 400: Bad Request

~> What can i do for you?


Traceback (most recent call last): File "/home/madhav/Projects/Jarvis/jarviscli/CmdInterpreter.py", line 151, in try_do do(self, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 219, in _plugin_run_with_network_error run_func(jarvis, s) File "/home/madhav/Projects/Jarvis/jarviscli/plugin.py", line 201, in run self._backend[0](jarvis.get_api(), s) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 50, in call self.parse_articles(self.get_headlines(jarvis), jarvis) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 153, in get_headlines return self._get(url) File "/home/madhav/Projects/Jarvis/jarviscli/plugins/news.py", line 176, in _get response = urllib.request.urlopen(url) File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.5/urllib/request.py", line 472, in open response = meth(req, response) File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.5/urllib/request.py", line 510, in error return self._call_chain(args) File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(args) File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 401: Unauthorized

~> What can i do for you?


madhavkulkarni1986 commented 5 years ago

@appi147 : Can you please assign this to me?

appi147 commented 5 years ago

Go ahead :)

appi147 commented 5 years ago

First one is not an issue. Update your api-key first. However, it should not crash, maybe give an error msg for adding/updating api key

appi147 commented 5 years ago

Well news configure works on my machine, it gives result in sorted order. However this issue occured in python 2.7

madhavkulkarni1986 commented 5 years ago

@appi147 Thanks for assigning. Yes, I am running 2.7. I will check about configure and let you know. But this has to be fixed right? Jarvis is intended to be used with 2.x as well as 3.x, correct?

appi147 commented 5 years ago

Yes

madhavkulkarni1986 commented 5 years ago

@appi147 I have the fixes and changes ready. What is the branching strategy? As I remember, you asked me to not modify my master. Can you please tell?

appi147 commented 5 years ago

I replied you on mail.