Merge pull request #29 from artiya4u/master
Fix cannot open "Ask HN" stories. #28
This commit is contained in:
commit
fbd2227a3c
|
@ -19,7 +19,7 @@ if(os.environ.get('TRAVIS')!='true'):
|
||||||
import appindicator_replacement as appindicator
|
import appindicator_replacement as appindicator
|
||||||
|
|
||||||
from appindicator_replacement import get_icon_filename
|
from appindicator_replacement import get_icon_filename
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import argparse
|
import argparse
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
|
@ -159,7 +159,7 @@ class HackerNewsApp:
|
||||||
webbrowser.open(widget.url)
|
webbrowser.open(widget.url)
|
||||||
|
|
||||||
if self.commentState:
|
if self.commentState:
|
||||||
webbrowser.open(self.HN_URL_PREFIX + widget.hn_id)
|
webbrowser.open(self.HN_URL_PREFIX + str(widget.hn_id))
|
||||||
self.tracker.visit(widget.url)
|
self.tracker.visit(widget.url)
|
||||||
|
|
||||||
def addItem(self, item):
|
def addItem(self, item):
|
||||||
|
@ -205,6 +205,9 @@ class HackerNewsApp:
|
||||||
#Add back all the refreshed news
|
#Add back all the refreshed news
|
||||||
for index, item in enumerate(data):
|
for index, item in enumerate(data):
|
||||||
item['history'] = searchResults[index]
|
item['history'] = searchResults[index]
|
||||||
|
if item['url'].startswith('item?id='):
|
||||||
|
item['url'] = "https://news.ycombinator.com/" + item['url']
|
||||||
|
|
||||||
self.addItem(item)
|
self.addItem(item)
|
||||||
# Catch network errors
|
# Catch network errors
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
|
|
Loading…
Reference in New Issue