diff --git a/.travis.yml b/.travis.yml index 964f05a..6e60d96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - "2.7" - "3.5" - "3.6" - # - "3.7-dev" + # - "3.7" before_install: - "pip install -U pip" - "python setup.py install" diff --git a/README.md b/README.md index 7ac468d..e58c29e 100644 --- a/README.md +++ b/README.md @@ -14,35 +14,32 @@ pip install rfd ## Usage +![rfd_peek](https://user-images.githubusercontent.com/4519234/42729852-d43a7768-87b3-11e8-81f2-36cb81bf4b58.gif) + ```bash -rfd threads [--count 10] +rfd threads [--limit 10] ``` -### Display first 5 threads from hot deals - -![screenshot](https://user-images.githubusercontent.com/4519234/37319853-3a03fb9c-2647-11e8-806e-17156541cf43.png) - -### tail a post: +### tail a post ```bash ▶ rfd posts https://forums.redflagdeals.com/koodo-targeted-public-mobile-12-120-koodo-6gb-40-no-referrals-2176935/ --tail 4 - --------------------------------------------------------------------------- - - [0] For those worried about credit ratings, according to Boworell, my credit score rose by 44 points since last month. I did absolutely nothing except open 3 Koodo lines all with medium tabs and I paid off 1 in full the very next day (Shaner) - --------------------------------------------------------------------------- - - [0] If we want to keep our PM plan but use the code to set up a spouse on the plan is that still okay? -I've read that the port can only be used once now, but does it matter which phone number is ported in? (kid_icarus) - --------------------------------------------------------------------------- - - [0] blackboxvr6 wrote: ↑Mar 12th, 2018 2:13 pm -Legit 1st line on Wednesday, no shipping email yet... - - -Tuesday before noon and still waiting. (gardener28) - --------------------------------------------------------------------------- - - [0] Ordered a SIM last Wednesday, haven't heard a peep from Koodo since the initial order confirmation e-mail. (DaJinx) - --------------------------------------------------------------------------- +``` + +## Tab Completion + +### bash + +```bash +echo 'eval "$(_RFD_COMPLETE=source rfd)"' >> ~/.profile +``` + +### zsh + +There isn't native support for zsh but zsh's bash completion compatibility mode works: + +```zsh +echo 'autoload bashcompinit \ +bashcompinit \ +eval "$(_FOO_BAR_COMPLETE=source foo-bar)"' >> ~/.zshrc ``` diff --git a/images/rfd_threads_9.png b/images/rfd_threads_9.png deleted file mode 100644 index 78a96e1..0000000 Binary files a/images/rfd_threads_9.png and /dev/null differ diff --git a/requirements.txt b/requirements.txt index 79dbcd4..0546621 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ beautifulsoup4>=4.6.0 -click>=6.7 +click>=6.0 colorama>=0.3.9 requests>=2.18.0 \ No newline at end of file diff --git a/rfd/__version__.py b/rfd/__version__.py index 360392a..2c14ccf 100644 --- a/rfd/__version__.py +++ b/rfd/__version__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -__version__ = '0.1.3' +__version__ = '0.1.4' diff --git a/rfd/rfd_cli.py b/rfd/rfd_cli.py index 5dc5d92..ee465e4 100644 --- a/rfd/rfd_cli.py +++ b/rfd/rfd_cli.py @@ -94,10 +94,10 @@ def posts(post_id, head, tail): @cli.command(short_help="Displays threads in the specified forum.") -@click.option('--count', default=10, help='Number of topics.') -@click.argument('forum_id') -def threads(count, forum_id): - """Displays threads in the specified forum id. +@click.option('--limit', default=10, help='Number of topics.') +@click.argument('forum_id', default=9) +def threads(limit, forum_id): + """Displays threads in the specified forum id. Defaults to 9. Popular forum ids: @@ -113,7 +113,7 @@ def threads(count, forum_id): 74 \t shopping discussion 88 \t cell phones """ - _threads = parse_threads(get_threads(forum_id, count), count) + _threads = parse_threads(get_threads(forum_id, limit), limit) for i, thread in enumerate(_threads, 1): click.echo(" " + str(i) + "." + get_vote_color(thread.get('score')) + Fore.RESET + thread.get('title'))