reddit-get


Namereddit-get JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/mikelane/reddit-get
SummaryA CLI to get reddit content
upload_time2023-03-11 20:39:46
maintainer
docs_urlNone
authorMichael Lane
requires_python>=3.8.0,<4.0.0
licenseMIT
keywords reddit cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Reddit Get
![Reddit-Get Integration](https://github.com/mikelane/reddit-get/workflows/Reddit-Get%20Integration/badge.svg)
[![codecov](https://codecov.io/gh/mikelane/reddit-get/branch/main/graph/badge.svg)](https://codecov.io/gh/mikelane/reddit-get)

This is a python CLI that will pull posts from Reddit. In order to use this CLI, you'll need to set up a 
Reddit app of your own so that you can authenticate into Reddit with your own credentials. Never fear, 
this process is pretty straight forward.

## Installation

Using python 3.8 or later, run `pip3 install reddit-get`. But also, you need to set up a reddit cli app so 
you can access reddit through the command line. See below for that.

### Create a Reddit Application

1. Navigate to https://reddit.com/prefs/apps
1. Click `create an app`
1. You should see something like this:

    ![create an app form](assets/create_an_app_form.png)

1. You can then fill this form out with some values like these (choose whatever you like):

    ![create an app form filled](assets/create_an_app_form_filled.png)

After that, you'll need to find the `client_id` and `client_secret` for your new app and insert those into 
a configuration file on your system.

### Adding a Reddit-Get Config File

1. Create a file in your home directory called `.redditgetrc` (currently this is the default name and is 
   only configurable when you call the script each time, so this name is probably for the best for now)
1. Make your reddit config file look like this:

    ```toml
   [reddit-get]
   client_id = "<your client id here>"
   client_secret = "<your client secret here>"
   user_agent = "<anything, e.g. My super awesome cli app by u/pm_me_myour_apps>" 
   username = "<your reddit username>"
   password = "<your reddit password>"
   ```

Once this is set up, you should be good to go. 

## Example Usage

Once you've got your cli app set up and reddit-get installed, you can run it like this:

```shell
$ reddit-get post --subreddit showerthoughts --post_sorting top --limit 10 --time_filter all --header --markdown
```
And here's what was returned today:

```markdown
##### *Top Posts from r/showerthoughts*
- *Whoever created the tradition of not seeing the bride in the wedding dress beforehand saved countless husbands everywhere from hours of dress shopping and will forever be a hero to all men.*
- *We laugh at dogs getting excited when they hear a bark on TV, but if TV was a nonstop stream of unintelligible noises and then someone suddenly spoke to you in your language, you'd be pretty fucking startled too.*
- *When you're a kid, you don't realize you're also watching your mom and dad grow up.*
- *Dads probably bond with dogs so much because, in our society, men don’t get shown a lot of affection but dogs give tons of affection regardless*
- *Being able to tolerate the sound of your own voice in a video is probably the highest form of self acceptance.*
- *Girls don't compliment guys because they're likely to take it non-platonically, guys take it non-platonically because it happens so infrequently they don't know how to handle it*
- *If elevators hadn't been invented, all the CEOs and important people would have their offices on the first floor as a sign of status.*
- *If EA suffers big enough losses from the backlash of Battlefront 2, and it all started because some guy couldn't unlock Vader, this will be the second time Anakin brought balance to something.*
- *Being able to do well in high school without having to put in much effort is actually a big disadvantage later in life.*
- *During a nuclear explosion, there is a certain distance of the radius where all the frozen supermarket pizzas are cooked to perfection.*
```

For more help with the post command, you can of course run

```shell
$ reddit-get post --help
```

---

Enjoy! This is early stages, so I'll be adding more features as time goes on.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mikelane/reddit-get",
    "name": "reddit-get",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.0,<4.0.0",
    "maintainer_email": "",
    "keywords": "reddit,cli",
    "author": "Michael Lane",
    "author_email": "mikelane@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1a/13/8e425c6c87f6d84ea8af700107a46bf267c0ca52f7fb85b2b92dd54b513e/reddit_get-1.1.0.tar.gz",
    "platform": null,
    "description": "# Reddit Get\n![Reddit-Get Integration](https://github.com/mikelane/reddit-get/workflows/Reddit-Get%20Integration/badge.svg)\n[![codecov](https://codecov.io/gh/mikelane/reddit-get/branch/main/graph/badge.svg)](https://codecov.io/gh/mikelane/reddit-get)\n\nThis is a python CLI that will pull posts from Reddit. In order to use this CLI, you'll need to set up a \nReddit app of your own so that you can authenticate into Reddit with your own credentials. Never fear, \nthis process is pretty straight forward.\n\n## Installation\n\nUsing python 3.8 or later, run `pip3 install reddit-get`. But also, you need to set up a reddit cli app so \nyou can access reddit through the command line. See below for that.\n\n### Create a Reddit Application\n\n1. Navigate to https://reddit.com/prefs/apps\n1. Click `create an app`\n1. You should see something like this:\n\n    ![create an app form](assets/create_an_app_form.png)\n\n1. You can then fill this form out with some values like these (choose whatever you like):\n\n    ![create an app form filled](assets/create_an_app_form_filled.png)\n\nAfter that, you'll need to find the `client_id` and `client_secret` for your new app and insert those into \na configuration file on your system.\n\n### Adding a Reddit-Get Config File\n\n1. Create a file in your home directory called `.redditgetrc` (currently this is the default name and is \n   only configurable when you call the script each time, so this name is probably for the best for now)\n1. Make your reddit config file look like this:\n\n    ```toml\n   [reddit-get]\n   client_id = \"<your client id here>\"\n   client_secret = \"<your client secret here>\"\n   user_agent = \"<anything, e.g. My super awesome cli app by u/pm_me_myour_apps>\" \n   username = \"<your reddit username>\"\n   password = \"<your reddit password>\"\n   ```\n\nOnce this is set up, you should be good to go. \n\n## Example Usage\n\nOnce you've got your cli app set up and reddit-get installed, you can run it like this:\n\n```shell\n$ reddit-get post --subreddit showerthoughts --post_sorting top --limit 10 --time_filter all --header --markdown\n```\nAnd here's what was returned today:\n\n```markdown\n##### *Top Posts from r/showerthoughts*\n- *Whoever created the tradition of not seeing the bride in the wedding dress beforehand saved countless husbands everywhere from hours of dress shopping and will forever be a hero to all men.*\n- *We laugh at dogs getting excited when they hear a bark on TV, but if TV was a nonstop stream of unintelligible noises and then someone suddenly spoke to you in your language, you'd be pretty fucking startled too.*\n- *When you're a kid, you don't realize you're also watching your mom and dad grow up.*\n- *Dads probably bond with dogs so much because, in our society, men don\u2019t get shown a lot of affection but dogs give tons of affection regardless*\n- *Being able to tolerate the sound of your own voice in a video is probably the highest form of self acceptance.*\n- *Girls don't compliment guys because they're likely to take it non-platonically, guys take it non-platonically because it happens so infrequently they don't know how to handle it*\n- *If elevators hadn't been invented, all the CEOs and important people would have their offices on the first floor as a sign of status.*\n- *If EA suffers big enough losses from the backlash of Battlefront 2, and it all started because some guy couldn't unlock Vader, this will be the second time Anakin brought balance to something.*\n- *Being able to do well in high school without having to put in much effort is actually a big disadvantage later in life.*\n- *During a nuclear explosion, there is a certain distance of the radius where all the frozen supermarket pizzas are cooked to perfection.*\n```\n\nFor more help with the post command, you can of course run\n\n```shell\n$ reddit-get post --help\n```\n\n---\n\nEnjoy! This is early stages, so I'll be adding more features as time goes on.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A CLI to get reddit content",
    "version": "1.1.0",
    "split_keywords": [
        "reddit",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e5da57d91775001ffd9df9197a7f10a8952e67df388fcf67fe6795155b08ec45",
                "md5": "ed8d22973877ec5aa7cebe552fdcbbb6",
                "sha256": "579d56e91068b7342c6297e041d95d2d2f99456bb69e8d1a7d66aa04a6e11453"
            },
            "downloads": -1,
            "filename": "reddit_get-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed8d22973877ec5aa7cebe552fdcbbb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.0,<4.0.0",
            "size": 8164,
            "upload_time": "2023-03-11T20:39:45",
            "upload_time_iso_8601": "2023-03-11T20:39:45.838205Z",
            "url": "https://files.pythonhosted.org/packages/e5/da/57d91775001ffd9df9197a7f10a8952e67df388fcf67fe6795155b08ec45/reddit_get-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a138e425c6c87f6d84ea8af700107a46bf267c0ca52f7fb85b2b92dd54b513e",
                "md5": "0dece5bf3efddc5a27ff02e1c5ca6e0b",
                "sha256": "d3efcf784bc75ff6813b539c7b680ce9afa123854ba52adb6124fd4bed9c802e"
            },
            "downloads": -1,
            "filename": "reddit_get-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0dece5bf3efddc5a27ff02e1c5ca6e0b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0,<4.0.0",
            "size": 7042,
            "upload_time": "2023-03-11T20:39:46",
            "upload_time_iso_8601": "2023-03-11T20:39:46.926588Z",
            "url": "https://files.pythonhosted.org/packages/1a/13/8e425c6c87f6d84ea8af700107a46bf267c0ca52f7fb85b2b92dd54b513e/reddit_get-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-11 20:39:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "mikelane",
    "github_project": "reddit-get",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "reddit-get"
}
        
Elapsed time: 0.04413s