Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SeoulSKY committed Jul 1, 2024
1 parent 004dc51 commit 8400de6
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 39 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ For more examples, please visit the [examples](https://github.com/SeoulSKY/ytnot

```python
from ytnoti import YouTubeNotifier, Video
from pyngrok import ngrok

# Create your ngrok token free from https://dashboard.ngrok.com/get-started/setup
ngrok.set_auth_token("Your ngrok token here")

notifier = YouTubeNotifier()

Expand Down
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ For more examples, please visit the `examples <https://github.com/SeoulSKY/ytnot
.. code:: python
from ytnoti import YouTubeNotifier, Video
from pyngrok import ngrok
# Create your ngrok token free from https://dashboard.ngrok.com/get-started/setup
ngrok.set_auth_token("Your ngrok token here")
notifier = YouTubeNotifier()
Expand Down
4 changes: 4 additions & 0 deletions examples/basic/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import asyncio

from pyngrok import ngrok

from ytnoti import AsyncYouTubeNotifier, Video


Expand All @@ -12,6 +14,8 @@ async def main():
Main function
"""

ngrok.set_auth_token("Your ngrok token here")

notifier = AsyncYouTubeNotifier()

@notifier.upload()
Expand Down
4 changes: 4 additions & 0 deletions examples/basic/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
This example demonstrates how to use the YouTubeNotifier to listen for new video uploads from a channel.
"""

from pyngrok import ngrok

from ytnoti import YouTubeNotifier, Video


Expand All @@ -10,6 +12,8 @@ def main():
Main function
"""

ngrok.set_auth_token("Your ngrok token here")

notifier = YouTubeNotifier()

@notifier.upload()
Expand Down
3 changes: 3 additions & 0 deletions examples/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This is an example of how to use decorators to listen to notifications.
"""

from pyngrok import ngrok

from ytnoti import YouTubeNotifier, Video

Expand All @@ -11,6 +12,8 @@ def main():
Main function
"""

ngrok.set_auth_token("Your ngrok token here")

notifier = YouTubeNotifier()

@notifier.any()
Expand Down
3 changes: 3 additions & 0 deletions examples/discord/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import discord
from discord import TextChannel
from pyngrok import ngrok

from ytnoti import AsyncYouTubeNotifier
from ytnoti.models.video import Video
Expand Down Expand Up @@ -80,6 +81,8 @@ async def on_message(self, message: discord.Message) -> None:


if __name__ == "__main__":
ngrok.set_auth_token("Your ngrok token here")

LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
LOG_LEVEL = logging.INFO
logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT)
Expand Down
7 changes: 0 additions & 7 deletions examples/docker/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions examples/docker/docker-compose.yml

This file was deleted.

28 changes: 0 additions & 28 deletions examples/docker/main.py

This file was deleted.

4 changes: 4 additions & 0 deletions examples/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from pathlib import Path

from pyngrok import ngrok

from ytnoti import YouTubeNotifier, Video
from ytnoti.models.history import FileVideoHistory

Expand All @@ -17,6 +19,8 @@ def main():
Main function
"""

ngrok.set_auth_token("Your ngrok token here")

# This will create a new folder called "videoHistory" in the current directory
video_history = FileVideoHistory(dir_path=Path("./videoHistory"))

Expand Down
4 changes: 4 additions & 0 deletions examples/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import logging

from pyngrok import ngrok

from ytnoti import YouTubeNotifier, Video


Expand All @@ -13,6 +15,8 @@ def main():
Main function
"""

ngrok.set_auth_token("Your ngrok token here")

logger = logging.getLogger(__name__)
notifier = YouTubeNotifier()

Expand Down
4 changes: 4 additions & 0 deletions examples/multithreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import time
from threading import Thread

from pyngrok import ngrok

from ytnoti import YouTubeNotifier, Video


Expand All @@ -13,6 +15,8 @@ def main():
Main function
"""

ngrok.set_auth_token("Your ngrok token here")

notifier = YouTubeNotifier()

@notifier.any()
Expand Down

0 comments on commit 8400de6

Please sign in to comment.