automated terminal push
This commit is contained in:
2
recycle/.trash/README.md
Normal file
2
recycle/.trash/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# yankee-fire-control-code
|
||||
|
||||
37
recycle/.trash/RestAPIClient (copy 1).py
Normal file
37
recycle/.trash/RestAPIClient (copy 1).py
Normal file
@@ -0,0 +1,37 @@
|
||||
import requests
|
||||
|
||||
## https://www.nylas.com/blog/use-python-requests-module-rest-apis/#how-to-use-python-requests
|
||||
|
||||
def callGET(url):
|
||||
|
||||
print("enter -> callGET()")
|
||||
|
||||
print("param / url / ",url)
|
||||
|
||||
params = dict(
|
||||
origin='Chicago,IL',
|
||||
destination='Los+Angeles,CA',
|
||||
waypoints='Joplin,MO|Oklahoma+City,OK',
|
||||
sensor='false',
|
||||
url2=url
|
||||
)
|
||||
|
||||
headers = {'Accept': 'application/json'}
|
||||
|
||||
print("params", params)
|
||||
|
||||
response = requests.post("https://osiris.yankee.valorantdigital.com/channel/monthly/games/success/exists", headers=headers, data=params, params=params)
|
||||
|
||||
print("response2", response.json())
|
||||
|
||||
def callPOST():
|
||||
|
||||
print("enter -> callPOST()")
|
||||
|
||||
response = requests.post('https://httpbin.org/post', data = {'key':'value'})
|
||||
|
||||
print("response", response.json())
|
||||
|
||||
callGET("https://embanet.online")
|
||||
|
||||
#callPOST()
|
||||
42
recycle/.trash/jmsclient.py
Normal file
42
recycle/.trash/jmsclient.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import stomp
|
||||
import time
|
||||
import veneno
|
||||
import fetcher
|
||||
|
||||
class MyListener(stomp.ConnectionListener):
|
||||
|
||||
def on_message(headers, message):
|
||||
|
||||
conn.ack(headers['message-id'])
|
||||
|
||||
print("** new message! **")
|
||||
|
||||
print(message)
|
||||
|
||||
fetcher.fetch(message.body)
|
||||
|
||||
|
||||
|
||||
def on_error(headers, message):
|
||||
|
||||
print('received an error "%s"' % message)
|
||||
|
||||
conn.ack(headers['message-id'])
|
||||
|
||||
conn = stomp.Connection([('osiris.yankee.valorantdigital.com', 61613)])
|
||||
|
||||
conn.set_listener('', MyListener())
|
||||
|
||||
conn.connect('admin', 'password', wait=True)
|
||||
|
||||
conn.subscribe('/queue/sully-gnome-urls', id=1, ack='client', headers={'activemq.prefetchSize': 10})
|
||||
|
||||
print("## notification > connected to JMS server")
|
||||
|
||||
while True:
|
||||
|
||||
pass
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
conn.disconnect()
|
||||
19
recycle/.trash/veneno.py
Normal file
19
recycle/.trash/veneno.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# veneno.py
|
||||
|
||||
def fetch(x):
|
||||
|
||||
print(f"launch -> data fetcher -> url -> {x}")
|
||||
|
||||
def eat(x,y):
|
||||
|
||||
"""Consumes x and y (pretend eating!).
|
||||
|
||||
Args:
|
||||
x: The first amount to be consumed.
|
||||
y: The second amount to be consumed.
|
||||
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
|
||||
print(f"Eating {x} and {y}...")
|
||||
Reference in New Issue
Block a user