automated terminal push

This commit is contained in:
Software Shinobi
2025-03-10 10:38:18 -04:00
parent 6a06716248
commit b502971a89
11 changed files with 154 additions and 2172 deletions

0
.trash/publisher.py Normal file
View File

19
.trash/trash.py Normal file
View File

@@ -0,0 +1,19 @@
def generate_urlsdddd(channel_name):
base_url = "https://sullygnome.com/channel/{}/{}/games"
for year in range(2024, 2025):
print("year / ",year)
for month in range(1, 13):
print("month / ",month)
month_str = utils.convertMonthNumberMonthLong(month)
customURL = base_url.format(channel_name, f"{year}{month_str}")
print("url / ", customURL)
writeToJMS(customURL)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

36
channels.py Normal file

File diff suppressed because one or more lines are too long

18
jms.py Normal file
View File

@@ -0,0 +1,18 @@
import stomp
def writeSullyURLToJMS(channel):
print(f"launch -> jms writer -> channel-> {channel}")
conn = stomp.Connection([('osiris.yankee.embanet.online', 61613)])
conn.connect('admin', 'password', wait=True)
try:
conn.send(body=channel.strip(), destination='/queue/yankee-sully-channels-monthly')
finally:
conn.disconnect()

File diff suppressed because it is too large Load Diff

32
sullygnome.py Normal file
View File

@@ -0,0 +1,32 @@
import utils
def generate_urls(channel_name, year_begin, year_end):
"""
Generates SullyGnome URLs for a given channel within a specified year range.
Args:
channel_name: The name of the Twitch channel.
year_begin: The starting year (inclusive).
year_end: The ending year (exclusive).
Returns:
A list of generated URLs.
"""
base_url = "https://sullygnome.com/channel/{}/{}/games"
urls = []
for year in range(year_begin, year_end):
for month in range(1, 13):
## print("month / ",month)
month_str = utils.convertMonthNumberMonthLong(month)
custom_url = base_url.format(channel_name, f"{year}{month_str}")
## print("final url / ", custom_url)
urls.append(custom_url)
return urls

20
utils.py Normal file
View File

@@ -0,0 +1,20 @@
import calendar
import random
def randomizeArray(arr):
"""
Returns a new randomized array without modifying the original.
"""
new_arr = arr[:] # Create a copy of the original array
random.shuffle(new_arr)
return new_arr
def convertMonthNumberMonthLong(month_number):
if not 1 <= month_number <= 12:
raise ValueError("Invalid month number")
month_name = calendar.month_name[month_number].lower().strip()
return f"{month_name}"