summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorryanss2015-02-03 23:59:00 -0500
committerryanss2015-02-03 23:59:00 -0500
commita7279b96939af4e4f348e5e0b745ab4d0f2da396 (patch)
tree17416d32fec2d3eed01211daf5bf01580380fa4f /plugin
parentd6c1e11d45c1a3cc7067643eabd73994cd441c36 (diff)
downloadvim-hn-a7279b96939af4e4f348e5e0b745ab4d0f2da396.tar.gz
Change item header to be more like website
Diffstat (limited to 'plugin')
-rw-r--r--plugin/hackernews.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/hackernews.py b/plugin/hackernews.py
index 8dc0a97..00e360e 100644
--- a/plugin/hackernews.py
+++ b/plugin/hackernews.py
@@ -85,9 +85,10 @@ def hacker_news_link():
id = m.group(1)
item = json.loads(urllib2.urlopen(API_URL+"/item/"+id).read())
vim.command("edit .hackernews")
- bwrite(item['title'])
- bwrite("Posted %s by %s" % (item['time_ago'], item['user']))
- bwrite("%d Points / %d Comments" % (item['points'], item['comments_count']))
+ bwrite("%s (%s)" % (item['title'], item['domain']))
+ bwrite("%d points by %s %s | %d comments"
+ % (item['points'], item['user'], item['time_ago'],
+ item['comments_count']))
if item['url'].find("item?id=") == 0:
item['url'] = "http://news.ycombinator.com/" + item['url']
bwrite("[%s]" % item['url'])