Skip to content

Commit

Permalink
Update code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLua authored Dec 5, 2024
1 parent dfb2fb1 commit 67252f3
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 29 deletions.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Monitor Instagram accounts for new posts and send them to a Discord webhook.
* Customizable **Discord embeds** for new posts and message contents including **mentions/pings**
* **User-definable refresh interval** for checking for new posts the second they are posted

.. code-block:: console
.. code:: console
instawebhooks [-h] [-q | -v] [-i REFRESH_INTERVAL] [-c MESSAGE_CONTENT] [-e] [--version]
instagram_username discord_webhook_url
Expand All @@ -62,7 +62,7 @@ Example

Below, InstaWebhooks is monitoring the Instagram account `raenlua <https://www.instagram.com/raenlua/>`_ for new posts and sending them to a Discord webhook every 30 minutes and sends a message to Discord with the post URL and the owner's name.

.. code-block:: console
.. code:: console
# Install InstaWebhooks
pip install instawebhooks
Expand All @@ -81,7 +81,7 @@ Installation

InstaWebhooks is available on `PyPI <https://pypi.org/project/instawebhooks/>`_, and can be installed using `pip`:

.. code-block:: console
.. code:: console
pip install instawebhooks
Expand All @@ -94,7 +94,7 @@ You can run ``instawebhooks --help`` to see the full list of options and argumen

The most basic usage of InstaWebhooks is to provide an Instagram account and a Discord webhook URL (replace ``<INSTAGRAM_USERNAME>`` and ``<DISCORD_WEBHOOK_URL>``):

.. code-block:: console
.. code:: console
instawebhooks <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
Expand Down
5 changes: 2 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Quickstart

With `Python <https://www.python.org/>`_ installed, install InstaWebhooks with `pip <https://pypi.org/project/pip/>`_:

.. code-block:: console
.. code:: console
$ pip install instawebhooks
After installing, you can run InstaWebhooks with the following command (change the username and webhook URL to your own):

.. code-block:: console
.. code:: console
$ instawebhooks raenlua https://discord.com/api/webhooks/0123456789/abcdefghijklmnopqrstuvwxyz
Expand All @@ -30,6 +30,5 @@ Contents

.. toctree::

Home <self>
installation
usage
12 changes: 6 additions & 6 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ The recommended way to install is using `pip <https://pypi.org/project/pip/>`_.

To install:

.. code-block:: console
.. code:: console
$ pip install instawebhooks
To upgrade to its latest release:

.. code-block:: console
.. code:: console
$ pip install --upgrade instawebhooks
Expand Down Expand Up @@ -66,24 +66,24 @@ Installing from source code is another option to contribute or use the latest de

1. `Clone the repository <https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository>`_ onto your machine

.. code-block:: console
.. code:: console
$ git clone https://github.com/RyanLua/InstaWebhooks.git
2. Navigate to the repository's directory

.. code-block:: console
.. code:: console
$ cd InstaWebhooks
3. Install the required packages that InstaWebhooks uses:

.. code-block:: console
.. code:: console
$ pip install -r requirements.txt
4. Enter `Development Mode <https://setuptools.pypa.io/en/latest/userguide/development_mode.html>`_:

.. code-block:: console
.. code:: console
$ pip install --editable .
56 changes: 40 additions & 16 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
Usage
=====

Usage is simple once you have everything installed, just run the script with the Instagram username you want to monitor and the Discord webhook URL you want to send new posts to.
To see the available options and arguments, run the following command:

.. code-block:: console
.. code:: console
$ instawebhooks
usage: instawebhooks [-h] [-v] [-i REFRESH_INTERVAL] [-c MESSAGE_CONTENT] [-e] [--version] instagram_username discord_webhook_url
$ instawebhooks --help
usage: instawebhooks [-h] [-q | -v] [-i REFRESH_INTERVAL] [-c MESSAGE_CONTENT] [-e] [--version]
instagram_username discord_webhook_url
Monitor Instagram accounts for new posts and send them to a Discord webhook
positional arguments:
instagram_username the Instagram username to monitor for new posts
discord_webhook_url the Discord webhook URL to send new posts to
options:
-h, --help show this help message and exit
-q, --quiet hide all logging
-v, --verbose show debug logging
-i REFRESH_INTERVAL, --refresh-interval REFRESH_INTERVAL
time in seconds to wait before checking for new posts again
-c MESSAGE_CONTENT, --message-content MESSAGE_CONTENT
the message content to send with the webhook
-e, --no-embed don't show the post embed and only send message content
--version show program's version number and exit
https://github.com/RaenLua/InstaWebhooks
Below, learn how to use InstaWebhooks and what you can do with it.

Examples
--------
Expand All @@ -15,46 +37,48 @@ In the below templates, replace ``<INSTAGRAM_USERNAME>`` with the Instagram user

Your command should look similar to this:

.. code-block:: console
.. code:: console
instawebhooks raenlua https://discord.com/api/webhooks/0123456789/abcdefghijklmnopqrstuvwxyz
$ instawebhooks raenlua https://discord.com/api/webhooks/0123456789/abcdefghijklmnopqrstuvwxyz
Templates
---------

Example templates for using InstaWebhooks are provided below. Note to change the Instagram username and Discord webhook URL to your own.

.. note::

The default refresh interval is 1 hour (3600 seconds), and the default message content is an empty string.

Send new posts every hour:

.. code-block:: console
.. code:: console
instawebhooks <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
$ instawebhooks <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
Send new posts every hour with verbose logging:

.. code-block:: console
.. code:: console
instawebhooks -v <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
$ instawebhooks -v <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
Send new posts every 30 minutes:

.. code-block:: console
.. code:: console
instawebhooks -i 1800 <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
$ instawebhooks -i 1800 <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
Send new posts every hour with a custom message:

.. code-block:: console
.. code:: console
instawebhooks -c "New post from {owner_name}: {post_url}" <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
$ instawebhooks -c "New post from {owner_name}: {post_url}" <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
Send new posts every hour with no embed and a custom message:

.. code-block:: console
.. code:: console
instawebhooks -e -c "New post from {owner_name}: {post_url}" <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
$ instawebhooks -e -c "New post from {owner_name}: {post_url}" <INSTAGRAM_USERNAME> <DISCORD_WEBHOOK_URL>
Reference
---------
Expand Down

0 comments on commit 67252f3

Please sign in to comment.