Giter Site home page Giter Site logo

rtv's Introduction

THIS PROJECT IS NO LONGER MAINTAINED

Reddit Terminal Viewer (RTV)

A text-based interface (TUI) to view and interact with Reddit from your terminal.

title image

Table of Contents

Demo

title image

You can use telnet or ssh to try out a lite version of RTV directly in your terminal, without needing to install it:

  • $ telnet redditbox.us
  • $ ssh redditbox.us

redditbox.us is an independent project by Alex Jarmoszuk

Installation

PyPI package

RTV is available on PyPI and can be installed with pip:

$ pip install rtv

Native packages

See Repology for an up-to-date list of supported distro packages:

# macOS
$ brew install rtv

# Arch
$ pacman -S rtv

# Nix
$ nix-env -i rtv

# Debian
$ apt install rtv

# FreeBSD
$ pkg install rtv

From source

$ git clone https://github.com/michael-lazar/rtv.git
$ cd rtv
$ python setup.py install

Windows

RTV is not supported on Windows, due to a lack of resources and interest. Sorry!

Usage

To run the program, type:

$ rtv --help

Controls

Move the cursor using either the arrow keys or Vim style movement:

  • Press and to scroll through submissions
  • Press to view the selected submission and to return
  • Press space-bar to expand/collapse comments
  • Press u to login (this requires a web browser for OAuth)
  • Press ? to open the help screen

Press / to open the navigation prompt, where you can type things like:

  • /front
  • /r/commandprompt+linuxmasterrace
  • /r/programming/controversial
  • /u/me
  • /u/multi-mod/m/art
  • /domain/github.com

See CONTROLS for the full list of commands.

Settings

Configuration File

Configuration files are stored in the {HOME}/.config/rtv/ directory.

Check out rtv.cfg for the full list of configurable options. You can clone this file into your home directory by running:

$ rtv --copy-config

Viewing Media Links

You can use mailcap to configure how RTV will open different types of links.

title image

A mailcap file allows you to associate different MIME media types, like image/jpeg or video/mp4, with shell commands. This feature is disabled by default because it takes a few extra steps to configure. To get started, copy the default mailcap template to your home directory.

$ rtv --copy-mailcap

This template contains examples for common MIME types that work with popular reddit websites like imgur, youtube, and gfycat. Open the mailcap template and follow the instructions listed inside.

Once you've setup your mailcap file, enable it by launching rtv with the rtv --enable-media flag (or set it in your rtv.cfg)

Environment Variables

The default programs that RTV interacts with can be configured through environment variables:

$RTV_EDITOR A program used to compose text submissions and comments, e.g. vim, emacs, gedit
If not specified, will fallback to $VISUAL and $EDITOR in that order.
$RTV_BROWSER A program used to open links to external websites, e.g. firefox, google-chrome, w3m, lynx
If not specified, will fallback to $BROWSER, or your system's default browser.
$RTV_URLVIEWER A tool used to extract hyperlinks from blocks of text, e.g. urlview, urlscan
If not specified, will fallback to urlview if it is installed.

Clipboard

RTV supports copying submission links to the OS clipboard. On macOS this is supported out of the box. On Linux systems you will need to install either xsel or xclip.

Themes

Themes can be used to customize the look and feel of RTV

Solarized Dark

Solarized Light

Papercolor

Molokai

You can list all installed themes with the --list-themes command, and select one with --theme. You can save your choice permanently in your rtv.cfg file. You can also use the F2 & F3 keys inside of RTV to cycle through all available themes.

For instructions on writing and installing your own themes, see THEMES.md.

FAQ

Why am I getting an error during installation/when launching rtv?

If your distro ships with an older version of python 2.7 or python-requests, you may experience SSL errors or other package incompatibilities. The easiest way to fix this is to install rtv using python 3. If you don't already have pip3, see http://stackoverflow.com/a/6587528 for setup instructions. Then do

$ sudo pip uninstall rtv
$ sudo pip3 install -U rtv
Why do I see garbled text like M-b~@M-" or ^@?

This type of text usually shows up when python is unable to render unicode properly.

  1. Try starting RTV in ascii-only mode with rtv --ascii
  2. Make sure that the terminal/font that you're using supports unicode
  3. Try setting the LOCALE to utf-8
  4. Your python may have been built against the wrong curses library, see here and here for more information
How do I run the code directly from the repository?

This project is structured to be run as a python module. This means that you need to launch it using python's -m flag. See the example below, which assumes that you have cloned the repository into the directory ~/rtv_project.

$ cd ~/rtv_project
$ python3 -m rtv

Contributing

All feedback and suggestions are welcome, just post an issue!

Before writing any code, please read the Contributor Guidelines.

License

This project is distributed under the MIT license.

rtv's People

Contributors

5225225 avatar brobin avatar codesoap avatar jjmcdn avatar juanpabloaj avatar jupart avatar mac1202 avatar mardigontoler avatar mekhami avatar michael-lazar avatar msabramo avatar mskwon avatar msmith491 avatar nagracks avatar nemanjan00 avatar no2chem avatar noahfx avatar noahmorrison avatar obosob avatar pabloariasal avatar professorjamesmoriarty avatar ram-z avatar reshefelisha avatar rreno17 avatar samtebbs33 avatar shawnhind avatar tobywhughes avatar tyjak avatar woorst avatar yskmt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtv's Issues

App crashes when trying to visit banned subreddits

I know this is a far-edge case, but I think the app should handle this.

Full trace:

Traceback (most recent call last):
  File "~/py3env/lib/python3.4/site-packages/rtv/content.py", line 240, in __init__
    self.get(0)
  File "~/py3env/lib/python3.4/site-packages/rtv/content.py", line 309, in get
    submission = next(self._submissions)
  File "~/py3env/lib/python3.4/site-packages/praw/__init__.py", line 508, in get_content
    page_data = self.request_json(url, params=params)
  File "~/py3env/lib/python3.4/site-packages/praw/decorators.py", line 163, in wrapped
    return_value = function(reddit_session, *args, **kwargs)
  File "~/py3env/lib/python3.4/site-packages/praw/__init__.py", line 561, in request_json
    retry_on_error=retry_on_error)
  File "~/py3env/lib/python3.4/site-packages/praw/__init__.py", line 403, in _request
    _raise_response_exceptions(response)
  File "~/py3env/lib/python3.4/site-packages/praw/internal.py", line 178, in _raise_response_exceptions
    response.raise_for_status()
  File "~/py3env/lib/python3.4/site-packages/requests/models.py", line 834, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/py3env/bin/rtv", line 7, in <module>
    from rtv.__main__ import main
  File "~/py3env/lib/python3.4/site-packages/rtv/__main__.py", line 133, in <module>
    sys.exit(main())
  File "~/py3env/lib/python3.4/site-packages/rtv/__main__.py", line 116, in main
    page.loop()
  File "~/py3env/lib/python3.4/site-packages/rtv/subreddit.py", line 45, in loop
    self.controller.trigger(cmd)
  File "~/py3env/lib/python3.4/site-packages/rtv/page.py", line 140, in trigger
    return func(self.instance, *args, **kwargs)
  File "~/py3env/lib/python3.4/site-packages/rtv/subreddit.py", line 88, in prompt_subreddit
    self.refresh_content(name=name)
  File "~/py3env/lib/python3.4/site-packages/rtv/subreddit.py", line 54, in refresh_content
    self.reddit, name, self.loader)
  File "~/py3env/lib/python3.4/site-packages/rtv/content.py", line 295, in from_name
    return cls(display_name, submissions, loader)
  File "~/py3env/lib/python3.4/site-packages/rtv/content.py", line 243, in __init__
    raise SubredditError(display_name)
NameError: name 'display_name' is not defined

XDG Specification

Follow XDG specs and read the config file in the following order:

  • $XDG_CONFIG_HOME/rtv/rtv.conf
  • ~/.config/rtv/rtv.conf (in case XDG_CONFIG_HOME is not set)
  • .rtv (for compatibility reasons)

[Feature] Log Browsing History over multiple sessions.

I love the feature that changes the color of visited links and posts in one session. It would be nice to have this work across sessions. Perhaps a history log file that is loaded on program start into the opened_links variable.

[rtv]
history=True

Then save in in a file rtv_history.log etc.

[Bug] Crashed on APIException

submission.py 123-125 (e referenced before assignment)

except praw.errors.APIException:
    message = ['Error: {}'.format(e.error_type), e.message]
    show_notification(self.stdscr, message)
    _logger.exception(e)

Should be

except praw.errors.APIException as e:
    message = ['Error: {}'.format(e.error_type), e.message]
    show_notification(self.stdscr, message)
    _logger.exception(e)

[Suggestion] A Command To Go Back to User's Front Page

This may be possible via visiting a subreddit alias that I'm not aware of, but it'd be nice to have a simple command to go back to the front page, currently if I navigate to a subreddit I have to exit and login again.

Typing '/' as subreddit name breaks the application

This is the error that I get:

 Traceback (most recent call last):
 File "main.py", line 102, in <module>
 main()
 File "main.py", line 83, in main
 page.loop()
 File "/usr/lib/python3.4/site-packages/rtv-1.0a2-py3.4.egg/rtv/subreddit.py", line 43, in loop
 self.prompt_subreddit()
 File "/usr/lib/python3.4/site-packages/rtv-1.0a2-py3.4.egg/rtv/subreddit.py", line 89, in prompt_subreddit
 self.refresh_content(name=out)
 File "/usr/lib/python3.4/site-packages/rtv-1.0a2-py3.4.egg/rtv/subreddit.py", line 67, in refresh_content
 self.reddit, name, self.loader)
 File "/usr/lib/python3.4/site-packages/rtv-1.0a2-py3.4.egg/rtv/content.py", line 332, in from_name
 sub = reddit.get_subreddit(name, fetch=True)
 File "/usr/lib/python3.4/site-packages/praw-2.1.20-py3.4.eg /praw/__init__.py", line 1017, in get_subreddit
 return objects.Subreddit(self, subreddit_name, *args, **kwargs)
 File "/usr/lib/python3.4/site-packages/praw-2.1.20-py3.4.egg/praw/objects.py", line 1346, in __init__
 subreddit_name = json_dict['url'].split('/')[2]
 TypeError: 'NoneType' object is not subscriptable
 sys:1: ResourceWarning: unclosed <socket object at 0x7f253b2b5d68>
 /usr/lib/python3.4/importlib/_bootstrap.py:2150: ImportWarning: sys.meta_path is empty

Not possible to combine multiple subreddits

Generally you can have a subreddit combination /r/a+b+c and you will get stories from a, b & c.

Rtv spits out "invalid subreddit" on subreddit combinations.

(great work btw!)

Getting an error when trying to open rtv

I will type rtv into the terminal and get this:

  Traceback (most recent call last):
File "/usr/bin/rtv", line 9, in <module>
load_entry_point('rtv==1.2.1', 'console_scripts', 'rtv')()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 522, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2647, in load_entry_point
return ep.load()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2320, in load
return self.resolve()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2326, in resolve
  module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "/usr/lib/python3.4/site-packages/rtv-1.2.1-py3.4.egg/rtv/__main__.py", line 133, in <module>
File "/usr/lib/python3.4/site-packages/rtv-1.2.1-py3.4.egg/rtv/__main__.py", line 115, in main
File "/usr/lib/python3.4/site-packages/rtv-1.2.1-py3.4.egg/rtv/subreddit.py", line 36, in __init__
File "/usr/lib/python3.4/site-packages/rtv-1.2.1-py3.4.egg/rtv/content.py", line 248, in from_name AttributeError: 'NoneType' object has no attribute 'strip'

So it looks like it is not loading with any default subreddit for me. I created a .cfg file manually in ~/.config/rtv and it works. Was this something that was supposed to happen automatically? If it was, I guess the error is that mine wasn't. If it isn't, a more intuitive, automatic way should be added.

ValueError: No JSON object could be decoded

kyelw@lappy ~ $ rtv
Connecting...
Traceback (most recent call last):
  File "/usr/local/bin/rtv", line 9, in <module>
    load_entry_point('rtv==1.3', 'console_scripts', 'rtv')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "build/bdist.linux-x86_64/egg/rtv/__main__.py", line 135, in <module>
  File "build/bdist.linux-x86_64/egg/rtv/__main__.py", line 111, in main
  File "/usr/local/lib/python2.7/dist-packages/praw-2.1.21-py2.7.egg/praw/__init__.py", line 1331, in login
    self.request_json(self.config['login'], data=data)
  File "/usr/local/lib/python2.7/dist-packages/praw-2.1.21-py2.7.egg/praw/decorators.py", line 163, in wrapped
    return_value = function(reddit_session, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/praw-2.1.21-py2.7.egg/praw/__init__.py", line 565, in request_json
    data = json.loads(response, object_hook=hook)
  File "/usr/lib/python2.7/json/__init__.py", line 351, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Looks like it could be an issue with praw possibly?

[Suggestion] New keybinding for opening links

I have been user rtv for a few days now and I have primarily been using the arrow keys to navigate the pages. I think it would be useful to bind the 'enter' key to open links in addition to the 'o' key. This makes it much easier for browse for those of us using the arrow keys.

[Feature suggestion] oauth login

Since reddit has moved to oauth it would be great to have that here. (Also makes me feel better than having to give my password directly to the application)

Long selfposts truncated

If I view a selfpost too long to fit on the screen, it is not possible to scroll.

As I mainly read the "tales subreddits", this is pretty bad.

Not sure if bug or feature request

Crash on https redirect on login

When logging into a reddit account that has https enabled the client can't handle the http -> https redirect and crashes.

$ rtv
Connecting...
Traceback (most recent call last):
File "/usr/bin/rtv", line 7, in
from rtv.main import main
File "/usr/lib/python2.7/site-packages/rtv/main.py", line 134, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/rtv/main.py", line 110, in main
reddit.login(args.username, args.password)
File "/usr/lib/python2.7/site-packages/praw/init.py", line 1334, in login
self.user = self.get_redditor(user)
File "/usr/lib/python2.7/site-packages/praw/init.py", line 949, in get_redditor
return objects.Redditor(self, user_name, _args, *_kwargs)
File "/usr/lib/python2.7/site-packages/praw/objects.py", line 746, in init
fetch, info_url)
File "/usr/lib/python2.7/site-packages/praw/objects.py", line 73, in init
self.has_fetched = self._populate(json_dict, fetch)
File "/usr/lib/python2.7/site-packages/praw/objects.py", line 133, in _populate
json_dict = self._get_json_dict() if fetch else {}
File "/usr/lib/python2.7/site-packages/praw/objects.py", line 126, in _get_json_dict
as_objects=False)
File "/usr/lib/python2.7/site-packages/praw/decorators.py", line 163, in wrapped
return_value = function(reddit_session, _args, *_kwargs)
File "/usr/lib/python2.7/site-packages/praw/init.py", line 561, in request_json
retry_on_error=retry_on_error)
File "/usr/lib/python2.7/site-packages/praw/init.py", line 402, in _request
response = handle_redirect()
File "/usr/lib/python2.7/site-packages/praw/init.py", line 376, in handle_redirect
url = _raise_redirect_exceptions(response)
File "/usr/lib/python2.7/site-packages/praw/internal.py", line 164, in _raise_redirect_exceptions
raise RedirectException(response.url, new_url)
praw.errors.RedirectException: Unexpected redirect from http://www.reddit.com/user/USERNAME/about/.json to https://www.reddit.com/user/USERNAME/about/.json

Missing functions?

I've run into a couple of functions that seem to be missing from the source code.
display_help (rtv/submission.py:66 and rtv/subreddit.py:56)
display_message (rtv/submission.py:239 and rtv/submission.py:280)

Support for flairs

Would be nice if we could support flairs from different subreddits. Would look something like

screenshot from 2015-03-05 20 20 33

Unexpected redirect

$ rtv
Connecting...
Traceback (most recent call last):
  File "/usr/bin/rtv", line 9, in <module>
    load_entry_point('rtv==1.2.1', 'console_scripts', 'rtv')()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 546, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2666, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2339, in load
    return self.resolve()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2345, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "/usr/lib/python3.4/site-packages/rtv-1.2.1-py3.4.egg/rtv/__main__.py", line 133, in <module>
  File "/usr/lib/python3.4/site-packages/rtv-1.2.1-py3.4.egg/rtv/__main__.py", line 110, in main
  File "/usr/lib/python3.4/site-packages/praw/__init__.py", line 1334, in login
    self.user = self.get_redditor(user)
  File "/usr/lib/python3.4/site-packages/praw/__init__.py", line 949, in get_redditor
    return objects.Redditor(self, user_name, *args, **kwargs)
  File "/usr/lib/python3.4/site-packages/praw/objects.py", line 746, in __init__
    fetch, info_url)
  File "/usr/lib/python3.4/site-packages/praw/objects.py", line 73, in __init__
    self.has_fetched = self._populate(json_dict, fetch)
  File "/usr/lib/python3.4/site-packages/praw/objects.py", line 133, in _populate
    json_dict = self._get_json_dict() if fetch else {}
  File "/usr/lib/python3.4/site-packages/praw/objects.py", line 126, in _get_json_dict
    as_objects=False)
  File "/usr/lib/python3.4/site-packages/praw/decorators.py", line 163, in wrapped
    return_value = function(reddit_session, *args, **kwargs)
  File "/usr/lib/python3.4/site-packages/praw/__init__.py", line 561, in request_json
    retry_on_error=retry_on_error)
  File "/usr/lib/python3.4/site-packages/praw/__init__.py", line 402, in _request
    response = handle_redirect()
  File "/usr/lib/python3.4/site-packages/praw/__init__.py", line 376, in handle_redirect
    url = _raise_redirect_exceptions(response)
  File "/usr/lib/python3.4/site-packages/praw/internal.py", line 164, in _raise_redirect_exceptions
    raise RedirectException(response.url, new_url)
praw.errors.RedirectException: Unexpected redirect from http://www.reddit.com/user/Thimoteus/about/.json to https://www.reddit.com/user/Thimoteus/about/.json

I got this error when I installed via sudo pip install rtv and by sudo python setup.py install.

Allow users to submit upvotes and downvotes

Users who are logged in should be able to vote on submissions and comments. I think the following keybinds would work:

u - upvote
d - downvote
c - clear vote

Applying the vote should be fairly easy, something like

submission_data = content.get(index)
submission_data['object'].upvote()

This would also entail adding a visual cue to indicate which items the user has voted on.

I'll leave this open in case anybody wants to work on it.

browser not opened when pressing enter or 'o'

My web browser (w3m) is not opened when I press o or enter.The link changes color, but nothing happens. I have confirmed that w3m is the default system browser - in fact, at the moment it is the only browser installed.

Any suggestions? What am I missing?

[Feature] Show gold symbol next to gilded comments

I think this would be a nifty little feature. Just like in the browser, show a little icon next to a gilded comment. I didn't see anything in the praw documentation about comment.gilded but it is a property of the reddit api comment.

u'\u2B24 ⬤ with Color.YELLOW would work nicely

Something like this.

│AlphaX • 299 pts 9hr ⬤x1
│What CSS feels like
│
│Edit: holly shit my first gold! I'm rich! I'll take two art please. Thanks
│mistery man.

Switching to non-existent subreddit crashes and throws a praw exception

I tried switching to /r/django and mispelled it djagno. This threw an exception and exited the program. Perhaps there is a better way to handle this?

praw.errors.RedirectException: Unexpected redirect from http://www.reddit.com/r/djagno/.json?limit=1024 to http://www.reddit.com/subreddits/search.json?q=djagno

Maybe we could catch the redirect exception and show the subreddit search, or just go to the first sub that shows up in that search.

[Feature Suggestion] Color themes

Subreddits like /r/itsaunixsystem have cool hacker custom css. I think it would be cool to implement some sort of theming for either the whole system, or for specific subreddits. This could be implemented using the .rtv file and allowing users to override the colors if they'd like. Thoughts?

Invalid username / password exception not handled

Trying to start with an invalid username or password raises the following exception

Traceback (most recent call last):
  File "main.py", line 114, in <module>
    main()
  File "main.py", line 83, in main
    reddit.login(args.username, args.password)
  File "/usr/local/lib/python2.7/dist-packages/praw/__init__.py", line 1330, in login
    self.request_json(self.config['login'], data=data)
  File "/usr/local/lib/python2.7/dist-packages/praw/decorators.py", line 189, in wrapped
    raise error_list[0]
praw.errors.InvalidUserPass: `wrong password` on field `passwd`

This should be caught and handled inside of main.py, similar to how subreddit name is being done. There should be a concise error message that includes the username and starred out password e.g. civilization_phaze_3:********

[Bug] Open self-posts in browser

Referenced by #3, after testing this out I've found a couple of bugs.

  • With Firefox 36.0 links open correctly but a warning message is spit out on the screen. This is especially annoying because it writes on top of the text generated by curses.
(process:7067): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_si e == 0' failed
  • Fails to open selfposts because data['url'] is saved as '(selfpost)' instead of the actual url.
  • We should enable this from inside the Submission view too, if the submission is selected.

[Feature Suggestion] Inline Image processing (In Terminal)

Ranger does this via

$ pacman -Ql ranger | grep -E 'image|img|w3m|picture|preview'
ranger /usr/lib/python3.3/site-packages/ranger/ext/__pycache__/img_display.cpython-33.pyc
ranger /usr/lib/python3.3/site-packages/ranger/ext/__pycache__/img_display.cpython-33.pyo
ranger /usr/lib/python3.3/site-packages/ranger/ext/img_display.py

$ grep 'w3m' /usr/lib/python3.3/site-packages/ranger/ext/img_display.py
...
W3MIMGDISPLAY_PATH = '/usr/lib/w3m/w3mimgdisplay'
...

404 error when posting comment

This has happened 3 times now. I post a response to someone's comment and the application dies with a 404 error. Are there relevant log files for me to show you to help diagnose the issue?

AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds' when using rtv in virtenv3.4

Getting this error when running rtv on centos 6.5 with python 3.4.3 in virtenv3.4

  File "/usr/bin/rtv", line 9, in <module>
    load_entry_point('rtv==1.0a1', 'console_scripts', 'rtv')()
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/main.py", line 51, in main
    page.loop()
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/subreddit.py", line 24, in loop
    self.draw()
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/page.py", line 142, in draw
    self._draw_content()
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/page.py", line 177, in _draw_content
    for data in self.content.iterate(page_index, step, n_cols-2):
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/content.py", line 78, in iterate
    yield self.get(index, n_cols=n_cols)
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/content.py", line 334, in get
    data = self.strip_praw_submission(submission)
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/content.py", line 148, in strip_praw_submission
    data['created'] = humanize_timestamp(sub.created_utc)
  File "/usr/lib/python2.6/site-packages/rtv-1.0a1-py2.6.egg/rtv/content.py", line 41, in humanize_timestamp
    seconds = int(timedelta.total_seconds())
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

Loading more comments is slow

Trying to load a large block of additional comments e.g. │More comments [427] takes a very very long time and a large number of http requests. I remember looking into this a while ago and finding out it was a limitation in the Reddit API itself. Never the less, we should try to find out if PRAW has an alternative method to the praw.objects.MoreComments().comments() which is currently being used.

[Bug] UnicodeEncodeError when replying to a post or comment that has unicode characters - Python 2.7

On python 2.7, if you try to respond to a comment that contains unicode characters, it crashes (reddit comment)

stack trace

File "build/bdist.linux-x86_64/egg/rtv/submission.py", line 42, in loop
  File "build/bdist.linux-x86_64/egg/rtv/page.py", line 140, in trigger
  File "build/bdist.linux-x86_64/egg/rtv/submission.py", line 98, in add_comment
UnicodeEncodeError: 'ascii' codec can't encode character u'\u15e7' in position 129: ordinal not in range(128)

Could not replicate on Python 3.4

Non-Ascii characters

I know that encoding is a sensitive issue, but is there a reason that you convert unicode string to ascii in clean function? That makes non-ascii characters (Japanese, Chinese, Korean, Arabic, Emoji, etc) not rendered.

For example, adding the following line in the beginning

import locale
locale.setlocale(locale.LC_ALL, '')

and changing encoding in clean function to something like this

utf8_string = unicode_string.encode('utf-8', 'replace')

make non-ascii characters rendered on the console.

rtv not using config file

I created ~/.config/rtv/rtv.cfg with my username and password in it as shown in the README. However when I run rtv then try and comment it tells me I need to be logged in to do that. Why would it not be reading my config file?

Unable to vote on post when viewing comments

I'm unable to upvote/downvote the post when viewing the comments. I see this in the log:

DEBUG:requests.packages.urllib3.connectionpool:"POST /api/vote/.json HTTP/1.1" 200 2

Let me know if any questions.

Displaying comments that don't fit on the screen

Single comments that are too large to fit in the screen will only be partially displayed. There is currently no way to view the hidden part of the comment, as scrolling down jumps all the way to the beginning of the next comment. Suggestions on how to solve this problem are welcome.

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.