mirror of
https://github.com/davegallant/rfd.git
synced 2025-08-07 00:58:14 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
399dc4e967 | ||
|
1af0556045 | ||
|
30e5bd1402 | ||
|
fac5c1018c | ||
|
9445c41d82 |
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
11
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,8 +1,9 @@
|
||||
|
||||
*Description of changes:*
|
||||
**What this PR does / why we need it:**
|
||||
-
|
||||
|
||||
*Checklist:*
|
||||
**Which issue(s) this PR fixes:**
|
||||
-
|
||||
|
||||
- [ ] Write unit tests
|
||||
- [ ] `make pr` passes
|
||||
- [ ] Write documentation
|
||||
**Additional Notes:**
|
||||
-
|
||||
|
@@ -4,8 +4,7 @@ sudo: false
|
||||
cache: false
|
||||
stages:
|
||||
- name: deploy
|
||||
# require the branch name to be master (note for PRs this is the base branch name)
|
||||
if: branch = master AND NOT type IN (pull_request)
|
||||
if: repo = davegallant/rfd AND tag IS present
|
||||
|
||||
before_install:
|
||||
- pip install -U pip
|
||||
|
15
README.md
15
README.md
@@ -4,21 +4,22 @@ Hot deals on the command line.
|
||||
|
||||
[](https://travis-ci.org/davegallant/rfd)
|
||||
[](https://badge.fury.io/py/rfd)
|
||||
[](https://dependabot.com/)
|
||||
[](https://lgtm.com/projects/g/davegallant/rfd/alerts/)
|
||||
[](https://lgtm.com/projects/g/davegallant/rfd/context:python)
|
||||
|
||||
## Installation
|
||||
|
||||

|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
pip install rfd
|
||||
```
|
||||
|
||||
## Usage
|
||||
## Use
|
||||
|
||||

|
||||
|
||||
|
||||
### threads
|
||||
### view threads
|
||||
```bash
|
||||
rfd threads [--forum-id 9] [--limit 10]
|
||||
```
|
||||
@@ -28,7 +29,7 @@ rfd threads [--forum-id 9] [--limit 10]
|
||||
rfd search pizza [--num-pages 100]
|
||||
```
|
||||
|
||||
## Tab Completion
|
||||
## Support Tab Completion
|
||||
|
||||
### bash
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
beautifulsoup4>=4.6.0
|
||||
beautifulsoup4>=4.8.1
|
||||
click>=7.0
|
||||
colorama>=0.3.9
|
||||
requests>=2.18.0
|
||||
colorama>=0.4.3
|
||||
requests>=2.22.0
|
||||
|
@@ -1,4 +1,4 @@
|
||||
pre-commit==1.18.3
|
||||
pre-commit==1.20.0
|
||||
pylint
|
||||
pytest>=4.6.6
|
||||
rope==0.14.0
|
||||
|
@@ -1 +1 @@
|
||||
0.3.3
|
||||
0.3.4
|
||||
|
@@ -116,6 +116,9 @@ def threads(limit, forum_id):
|
||||
+ get_vote_color(thread.score)
|
||||
+ Fore.RESET
|
||||
+ "[%s] %s" % (thread.dealer_name, thread.title)
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ " (%d views)" % thread.total_views
|
||||
+ Fore.RESET
|
||||
)
|
||||
click.echo(Fore.BLUE + " {}".format(thread.url))
|
||||
click.echo(Style.RESET_ALL)
|
||||
|
@@ -1,10 +1,11 @@
|
||||
# pylint: disable=old-style-class
|
||||
class Thread:
|
||||
def __init__(self, title, dealer_name, score, url):
|
||||
def __init__(self, title, dealer_name, score, url, total_views):
|
||||
self.dealer_name = dealer_name
|
||||
self.score = score
|
||||
self.title = title
|
||||
self.url = url
|
||||
self.total_views = total_views
|
||||
|
||||
def __repr__(self):
|
||||
return "Thread(%s)" % self.title
|
||||
|
@@ -29,6 +29,7 @@ def parse_threads(threads, limit):
|
||||
dealer_name=topic["offer"].get("dealer_name"),
|
||||
score=calculate_score(topic),
|
||||
url=build_web_path(topic.get("web_path")),
|
||||
total_views=topic.get("total_views"),
|
||||
)
|
||||
)
|
||||
return parsed_threads
|
||||
|
Reference in New Issue
Block a user