hnterminal


Namehnterminal JSON
Version 0.7.0 PyPI version JSON
download
home_page
SummaryAn terminal CLI env for Hacker News
upload_time2023-03-26 15:52:27
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords hacker news cli repl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # hnterminal

`pip install hnterminal`

This CLI tool supports browsing, login, upvote and commenting for full HN experience in the terminal.

Built on top of [HN API](https://github.com/HackerNews/API) and [replbuilder](https://github.com/Aperocky/replbuilder).

## Installation

`pip install hnterminal`

`$ hnterminal` will invoke the terminal command from shell, if pip installation is in your `PATH`

You may also run `python src/cli.py` off current repository.

## Usage

The CLI and each of its command have detailed help sections that you can utilize:

![help](images/help.jpg)

You can quickly navigate the front page:

![front_page](images/front_page.jpg)

Login and upvote what you like using pointers:

![upvote](images/login.jpg)

`get_tree` use DFS to create a comment tree, you can use this command on any pointer shown. Additionally, `-1` pointer is reserved for parent, so you can trace a comment all the way up.

![tree_story](images/get_tree_story.jpg)

Same command used on comments:

![tree_comment](images/get_tree_comment.jpg)

You can reply to story or comments utilizing the same pointer, even using an editor to craft your response:

![reply_vim](images/reply_vim.jpg)

![reply_complete](images/replied.jpg)

The comment will then show up (the read API will take ~30 seconds to be up to date):

![reply_shown](images/reply_shown.jpg)

This terminal tool is *responsive!* and the output will be adjusted to the width of the terminal for everything it displays

![responsive browsing](images/responsive_term.jpg)

You can also use aliases to shorten most used, repetitive commands:

![alias](images/alias.jpg)

There are more to this tool, for instance, it has the capability to show user info and history, it enables seamless browsing experience by maintaining a cache which status you can check with cache commands, which you may want to clear from time to time to keep it from going stale if you spend hours in this tool. The ultimate goal is to provide the same HN browsing experience in the terminal.

## Usage (No Image)

See a textual demo (color and styles not available via markdown):

```
aperocky@~$ hnterminal
hnterminal > get_front_page -n 5
POINTER | AUTHOR                   | SCORE | COMMENT | AGE        | BASE URL
1       | Apple: Transformer architecture optimized for Apple Silicon
        | behnamoh                 | 330   | 134     | 3 hours    | github.com
2       | You can't tell people anything (2004)
        | alexslobodnik            | 131   | 53      | 3 hours    | habitatchronicles.com
3       | ChatGPT Plugins
        | bryanh                   | 1393  | 754     | 8 hours    | openai.com
4       | Relativity Space launches first 3D-printed rocket on historic test flight
        | Stevvo                   | 186   | 90      | 9 hours    | www.space.com
5       | I Bought Back My Acquihired Startup
        | mokkol                   | 137   | 41      | 4 hours    | steveridout.com

hnterminal > login USERNAME PASSWORD
Successfully logged in as USERNAME

hnterminal > upvote 4
POINTER 4 is [UPVOTED]

hnterminal > get_tree 4
POINTER -1: PARENT STORY
Relativity Space launches first 3D-printed rocket on historic test flight
2023-03-23 12:28:25
AUTHOR: Stevvo
FULL URL: https://www.space.com/relativity-space-terran-1-test-launch-failure
POINTER/AUTHOR      | COMMENTS
1                   | honestly the most impressive part of relativity space is how young their founder is.
croatiancoder       | 
2023-03-23 12:35:58 | 

2 [UPVOTED]               | Jordan was 22 when they started!!
jessfraz                  | 
2023-03-23 15:14:19       | 

3                               | Damn he’s my age and I’m still a startup engineer while he’s leading rocket
robopsychology                  | engineering lol - what a person!
2023-03-23 18:56:21             | 

4                               | How does a 22 year old get the funding to start something like this?
AnimalMuppet                    | 
2023-03-23 15:53:02             | 

hnterminal > reply_to 1 -e
... opens vim editor ...

EDITOR OUTPUT:
"... whatever you wrote ..."
Comment Published
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hnterminal",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "hacker news,cli,repl",
    "author": "",
    "author_email": "Rocky Li <aperocky@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/b2/a7992d7f3f21424812d28e28d9a6d0eb1b4dcc4666952010cce780e0a132/hnterminal-0.7.0.tar.gz",
    "platform": null,
    "description": "# hnterminal\n\n`pip install hnterminal`\n\nThis CLI tool supports browsing, login, upvote and commenting for full HN experience in the terminal.\n\nBuilt on top of [HN API](https://github.com/HackerNews/API) and [replbuilder](https://github.com/Aperocky/replbuilder).\n\n## Installation\n\n`pip install hnterminal`\n\n`$ hnterminal` will invoke the terminal command from shell, if pip installation is in your `PATH`\n\nYou may also run `python src/cli.py` off current repository.\n\n## Usage\n\nThe CLI and each of its command have detailed help sections that you can utilize:\n\n![help](images/help.jpg)\n\nYou can quickly navigate the front page:\n\n![front_page](images/front_page.jpg)\n\nLogin and upvote what you like using pointers:\n\n![upvote](images/login.jpg)\n\n`get_tree` use DFS to create a comment tree, you can use this command on any pointer shown. Additionally, `-1` pointer is reserved for parent, so you can trace a comment all the way up.\n\n![tree_story](images/get_tree_story.jpg)\n\nSame command used on comments:\n\n![tree_comment](images/get_tree_comment.jpg)\n\nYou can reply to story or comments utilizing the same pointer, even using an editor to craft your response:\n\n![reply_vim](images/reply_vim.jpg)\n\n![reply_complete](images/replied.jpg)\n\nThe comment will then show up (the read API will take ~30 seconds to be up to date):\n\n![reply_shown](images/reply_shown.jpg)\n\nThis terminal tool is *responsive!* and the output will be adjusted to the width of the terminal for everything it displays\n\n![responsive browsing](images/responsive_term.jpg)\n\nYou can also use aliases to shorten most used, repetitive commands:\n\n![alias](images/alias.jpg)\n\nThere are more to this tool, for instance, it has the capability to show user info and history, it enables seamless browsing experience by maintaining a cache which status you can check with cache commands, which you may want to clear from time to time to keep it from going stale if you spend hours in this tool. The ultimate goal is to provide the same HN browsing experience in the terminal.\n\n## Usage (No Image)\n\nSee a textual demo (color and styles not available via markdown):\n\n```\naperocky@~$ hnterminal\nhnterminal > get_front_page -n 5\nPOINTER | AUTHOR                   | SCORE | COMMENT | AGE        | BASE URL\n1       | Apple: Transformer architecture optimized for Apple Silicon\n        | behnamoh                 | 330   | 134     | 3 hours    | github.com\n2       | You can't tell people anything (2004)\n        | alexslobodnik            | 131   | 53      | 3 hours    | habitatchronicles.com\n3       | ChatGPT Plugins\n        | bryanh                   | 1393  | 754     | 8 hours    | openai.com\n4       | Relativity Space launches first 3D-printed rocket on historic test flight\n        | Stevvo                   | 186   | 90      | 9 hours    | www.space.com\n5       | I Bought Back My Acquihired Startup\n        | mokkol                   | 137   | 41      | 4 hours    | steveridout.com\n\nhnterminal > login USERNAME PASSWORD\nSuccessfully logged in as USERNAME\n\nhnterminal > upvote 4\nPOINTER 4 is [UPVOTED]\n\nhnterminal > get_tree 4\nPOINTER -1: PARENT STORY\nRelativity Space launches first 3D-printed rocket on historic test flight\n2023-03-23 12:28:25\nAUTHOR: Stevvo\nFULL URL: https://www.space.com/relativity-space-terran-1-test-launch-failure\nPOINTER/AUTHOR      | COMMENTS\n1                   | honestly the most impressive part of relativity space is how young their founder is.\ncroatiancoder       | \n2023-03-23 12:35:58 | \n\n2 [UPVOTED]               | Jordan was 22 when they started!!\njessfraz                  | \n2023-03-23 15:14:19       | \n\n3                               | Damn he\u2019s my age and I\u2019m still a startup engineer while he\u2019s leading rocket\nrobopsychology                  | engineering lol - what a person!\n2023-03-23 18:56:21             | \n\n4                               | How does a 22 year old get the funding to start something like this?\nAnimalMuppet                    | \n2023-03-23 15:53:02             | \n\nhnterminal > reply_to 1 -e\n... opens vim editor ...\n\nEDITOR OUTPUT:\n\"... whatever you wrote ...\"\nComment Published\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An terminal CLI env for Hacker News",
    "version": "0.7.0",
    "split_keywords": [
        "hacker news",
        "cli",
        "repl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91a6b4a2deb7628a57957fabff1ad651fbf414d6e87da76c926a05fc3d721a82",
                "md5": "c6066ebb6011828bb83c12adef236b17",
                "sha256": "e0f2e8657fc45e671b7801fdf5afe53f45b8c20ff62638a856341e534be3d634"
            },
            "downloads": -1,
            "filename": "hnterminal-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6066ebb6011828bb83c12adef236b17",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15243,
            "upload_time": "2023-03-26T15:52:25",
            "upload_time_iso_8601": "2023-03-26T15:52:25.441686Z",
            "url": "https://files.pythonhosted.org/packages/91/a6/b4a2deb7628a57957fabff1ad651fbf414d6e87da76c926a05fc3d721a82/hnterminal-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7b2a7992d7f3f21424812d28e28d9a6d0eb1b4dcc4666952010cce780e0a132",
                "md5": "795fecf83c3813164f4a428dd8790b60",
                "sha256": "8da051462dc444e49d94e679c4c7b74e13937eeaf9c3ee7b1a132cfcb4c7d55b"
            },
            "downloads": -1,
            "filename": "hnterminal-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "795fecf83c3813164f4a428dd8790b60",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12614,
            "upload_time": "2023-03-26T15:52:27",
            "upload_time_iso_8601": "2023-03-26T15:52:27.094842Z",
            "url": "https://files.pythonhosted.org/packages/a7/b2/a7992d7f3f21424812d28e28d9a6d0eb1b4dcc4666952010cce780e0a132/hnterminal-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-26 15:52:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "hnterminal"
}
        
Elapsed time: 0.05396s