Compare commits
3 Commits
6a06716248
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f6cf2ef0d | ||
| 6e03b34f2d | |||
|
|
b502971a89 |
0
.trash/publisher.py
Normal file
0
.trash/publisher.py
Normal file
19
.trash/trash.py
Normal file
19
.trash/trash.py
Normal 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)
|
||||
BIN
__pycache__/channels.cpython-310.pyc
Normal file
BIN
__pycache__/channels.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/jms.cpython-310.pyc
Normal file
BIN
__pycache__/jms.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/sullygnome.cpython-310.pyc
Normal file
BIN
__pycache__/sullygnome.cpython-310.pyc
Normal file
Binary file not shown.
BIN
__pycache__/utils.cpython-310.pyc
Normal file
BIN
__pycache__/utils.cpython-310.pyc
Normal file
Binary file not shown.
36
channels.py
Normal file
36
channels.py
Normal file
File diff suppressed because one or more lines are too long
18
jms.py
Normal file
18
jms.py
Normal 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()
|
||||
|
||||
2202
publisher.py
2202
publisher.py
File diff suppressed because it is too large
Load Diff
32
sullygnome.py
Normal file
32
sullygnome.py
Normal 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
20
utils.py
Normal 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}"
|
||||
Reference in New Issue
Block a user