Coder Social home page Coder Social logo

hackq-trivia's People

Contributors

exaphis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hackq-trivia's Issues

String encoding problems

During the last game, the websocket_handler threw an error when trying to print the answers it retrieved.

File "/Users/cwong/Desktop/Dropbox/Github/hq-hint/networking.py", line 64, in websocket_handler print(answers) UnicodeEncodeError: 'ascii' codec can't encode character '\xe1' in position 7: ordinal not in range(128)

Please help

Hi,

I’ve been looking at your HQ trivia bot and its something id love to use, however I known next to nothing about coding and was wondering if there was any chance you would be willing to send a really simple method of what I need to do to access and use this bot. I have tried to put it all together but I honestly have no clue what to do. If you can’t help don’t worry but I thought it was worth asking.

Thanks,

Lawrence

HQ Trivia UK URL

Would it be possible to amend the code slightly to use this with Cash Show?

Incorrect searching URL

Hi, great piece of work you got, I found a problem while trying to search in the retrieved links as their format is incorrect:

image

Heartbeat?

I have received this while trying to run it during a show.

getting

Show active, connecting to socket at https://ws-quiz.hype.space/ws/44342
Traceback (most recent call last):
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\HackQ-Trivia-master\hq_main.py", line 51, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Dinge\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\HackQ-Trivia-master\networking.py", line 45, in websocket_handler
async with session.ws_connect(uri, headers=headers, heartbeat=5) as ws:
TypeError: ws_connect() got an unexpected keyword argument 'heartbeat'

How do I find my bearer token and user id

I tried this on the UK version this afternoon but it just said show not on, do I need my own bearer token and user id or is there a different http address to connect to the game please?

Please Help!

Can you please explain how to do set this up?

how to use the steps after nltk.download("all")

i don't know where is the conn_settings.txt file or how to locate it. please tell me.
second thing is whenever i use
usage: python3 hq_main.py in python 3.6 version it shows a syntax error.
please help me with these two steps.

This is probably an easy fix problem

I am having trouble figuring out what a bearer token and user id is, and how I can find them. Everything else works perfectly normal. If you could help me out by telling me how to find them and sniff a phone server, or even just giving me a link to a tutorial that would be nice. Thank You.

KeyError: 'type'

I think I did everything right, but i'm getting a key error when I try to run it.
What happens is:

screen shot 2018-03-07 at 8 55 47 pm

then it just stops. Any idea as to what could be wrong?

Error

I get this error after entering python hq-main.py
C:\Users\dylri\AppData\Local\Programs\Python\Python36-32\python.exe: can't open file 'hq-main.py': [Errno 2] No such file or directory

Reading the log as a JSON structure

I am working on finishing up my Swift version of this cheat, and I was wondering if there was a way for me to read the log in a JSON type format (with all the right indentations/spacing) so that it is easy to read the structure because I can't debug when the game isn't live. Let me know if you have any programs that do this. Thanks.

How to add search method 3 for added stability

best_answer = __search_method1(search_text, answers, reverse)
if best_answer == "":
best_answer = __search_method2(search_text, answers, reverse)
# best_answer = __search_method3(question_keywords, answers, reverse)

If I wanted to add search method 3 as well to have all of them display just to get a greater chance of answering a question correctly, could I do something like this for the answer_question function:

def answer_question(question, answers):
    print("Searching")
    start = time.time()

    answers = list(map(lambda x: x.translate(punctuation_to_none), answers))

    reverse = "NOT" in question or ("least" in question.lower() and "at least" not in question.lower())
    question_keywords = search.find_keywords(question)
    print(question_keywords)
    search_results = search.search_google(" ".join(question_keywords), 5)
    print(search_results)

    # Parallelize access of found URLs
    search_text = Parallel(n_jobs=cpu_count())(delayed(get_no_punctuation_text)(url) for url in search_results)

    best_answer1 = __search_method1(search_text, answers, reverse)
    best_answer2 = __search_method2(search_text, answers, reverse)
    best_answer3 = __search_method3(question_keywords, answers, reverse)

    print("Search took {} seconds".format(time.time() - start))
    return best_answer1 + best_answer2 + best_answer3

and then printing this in the hq_main file:

print(question.answer_question(question_s, answers))

or would I have to change something?

No answers

Hey I just tried your trivia bot but for every answer i always got 0 matches i think something was wrong with the searching urls could you please help me

Capturing bearer tokens

I am trying to find my bearer token using a proxy but whenever I get the data it is just a jumbled mess. I have tried using Fiddler 2, Charles Proxy, and Postman, but whatever I do either HQ just wont load the data or when it does capture it it just looks like a bunch of random characters. Any ideas?

nltk problem

Everything was going great until I came across this problem when I did nltk.download("all") it came up with this error. Can you please help me?
screen shot 2018-04-03 at 10 27 01 pm

Lots of errors before starting the methods

On most of the questions I get a lot of error code popping up before method 1 statrt. It still provides an answer, but makes everything messy and harder to find. Also, on a side note, why isn't method 2 running? (i haven't changed any of the code)

Here is an example:

Question detected.
Question 1 out of 12
According to the old song “Row, Row, Row Your Boat,” life is but a what?
['Dream', 'Massive phoenix tattoo', 'Bitcoin scam']

Searching
['Dream', 'Massive phoenix tattoo', 'Bitcoin scam']
['according', 'old', 'song', 'row, row, row your boat,', 'life']
['https://en.wikipedia.org/wiki/Row,_Row,_Row_Your_Boat', 'https://www.youtube.com/watch?v=EDrVCqeZIAY', 'http://sausedo.net/2012/10/25/the-truth-about-row-row-row-your-boat/', 'http://thedailyranter.com/articles/things-people-dont-realize/2013/11/10/row-row-row-your-boat-is-a-totally-twisted-fucked-up-song', 'https://mudcat.org/thread.cfm?threadid=21766']
Server timeout/error to http://sausedo.net/2012/10/25/the-truth-about-row-row-row-your-boat/
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\Topher\Documents\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 783, in aenter
self._resp = await self._coro
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 333, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 708, in start
self._continue = None
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 670, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\Users\Topher\Documents\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "C:\Users\Topher\Documents\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Running method 1
{'dream': 32, 'massive phoenix tattoo': 0, 'bitcoin scam': 0}
dream

Question nouns: ['row, row, row your boat,']
Running method 3
Search processed
URLs fetched

Dream: {'row, row, row your boat,': 0}
Massive phoenix tattoo: {'row, row, row your boat,': 0}
Bitcoin scam: {'row, row, row your boat,': 0}

Keyword scores: {'Dream': 36, 'Massive phoenix tattoo': 9, 'Bitcoin scam': 9}
Noun scores: {'Dream': 0, 'Massive phoenix tattoo': 0, 'Bitcoin scam': 0}
Dream

Doesnt Work

getting this error
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44256
Connected
Traceback (most recent call last):
File "C:\Users\test\Desktop\HackQ-Trivia-master\hq_main.py", line 51, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Program Files\Python36\lib\asyncio\base_events.py", line 467, in run_until_complete
return future.result()
File "C:\Users\test\Desktop\HackQ-Trivia-master\networking.py", line 56, in websocket_handler
raise RuntimeError("Connection settings invalid")
RuntimeError: Connection settings invalid

Highlight answers and more errors

It's hard to find the answer in the result below. Could you perhaps update the script to highlight the answer or show it in a different colour?

`Question detected.
Question 9 out of 12
The fashion brand Opening Ceremony once put on a play co-written by what actor?
['Jonah Hill', 'Chloë Sevigny', 'Jesse Eisenberg']

Searching
['Jonah Hill', 'Chloe Sevigny', 'Jesse Eisenberg']
['fashion', 'brand', 'opening', 'ceremony', 'put', 'play', 'co', 'written', 'actor']
['https://www.vanityfair.com/style/2014/09/opening-ceremony-new-york-fashion-week-jonah-hill', 'http://www.dazeddigital.com/fashion/article/21578/1/read-an-exclusive-interview-with-jonah-hill-and-spike-jonze', 'http://www.dazeddigital.com/fashion/article/21259/1/spike-jonze-is-staging-a-play-for-opening-ceremony-ss15', 'http://creativity-online.com/work/opening-ceremonyspike-jonze-100-lost-cotton/37077', 'https://en.wikipedia.org/wiki/Opening_Ceremony_(brand)']
Running method 1
{'jonah hill': 39, 'chloe sevigny': 1, 'jesse eisenberg': 0}
jonah hill

[('The', 'DT'), ('fashion', 'NN'), ('brand', 'NN'), ('Opening', 'NNP'), ('Ceremony', 'NNP'), ('once', 'RB'), ('put', 'VBD'), ('on', 'IN'), ('a', 'DT'), ('play', 'NN'), ('co-written', 'JJ'), ('by', 'IN'), ('what', 'WP'), ('actor', 'NN'), ('?', '.')]
Question nouns: ['fashion brand opening ceremony']
Running method 3
Search processed
URLs fetched

Jonah Hill: {'fashion brand opening ceremony': 0}
Chloë Sevigny: {'fashion brand opening ceremony': 0}
Jesse Eisenberg: {'fashion brand opening ceremony': 0}

Keyword scores: {'Jonah Hill': 48, 'Chloë Sevigny': 68, 'Jesse Eisenberg': 83}
Noun scores: {'Jonah Hill': 0, 'Chloë Sevigny': 0, 'Jesse Eisenberg': 0}
Jonah Hill
Search took 7.578475713729858 seconds

Socket closed

Show active, connecting to socket at https://ws-quiz.hype.space/ws/44181
Connected`

Also, I'm still getting errors every now and then and I'm already using the latest version.

`Question detected.
Question 10 out of 12
Which of these products was originally developed for surgical use?
['Listerine', 'Bengay', 'VapoRub']

Searching
['Listerine', 'Bengay', 'VapoRub']
['products', 'originally', 'developed', 'surgical', 'use']
['http://mentalfloss.com/article/29840/6-hugely-successful-products-originally-invented-something-else', 'https://en.wikipedia.org/wiki/Surgical_instrument', 'https://en.wikipedia.org/wiki/Joseph_Lister', 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1356187/', 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1121442/']
Server timeout/error to http://mentalfloss.com/article/29840/6-hugely-successful-products-originally-invented-something-else
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 407, in _request
break
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "", line 1, in
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Server timeout/error to https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1121442/
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "", line 1, in
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Server timeout/error to https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1356187/
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "", line 1, in
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Running method 1
{'listerine': 2, 'bengay': 0, 'vaporub': 0}
listerine

[('Which', 'NNP'), ('of', 'IN'), ('these', 'DT'), ('products', 'NNS'), ('was', 'VBD'), ('originally', 'RB'), ('developed', 'VBN'), ('for', 'IN'), ('surgical', 'JJ'), ('use', 'NN'), ('?', '.')]
Question nouns: ['use']
Running method 3
Search processed
Server timeout/error to https://www.more.com/lifestyle/exercise-health/12-surprising-uses-vicks-vaporub
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "", line 1, in
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Server timeout/error to https://vicks.com/en-us/safety-and-faqs/faqs/vicks-vaporub-faq
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "", line 1, in
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)`

Conn settings file

I'm confused on where to put the bearer token and the user I'd in the conn settings file. I have the file, and I have the bearer token and the user ID. I am just confused on where to put them in the file. Thanks for your help! Also, I was wondering how accurate is it?

Resource punkt not found.

Thanks a lot for sharing this! Thought I had everything working, but I appear to have done something wrong with installing or importing nltk (see image for error). I had added...

import nltk
nltk.download("stopwords")
nltk.download("averaged_perceptron_tagger")

...to the top of hq_main.py instead of executing those lines beforehand, as I was having trouble getting them to run in terminal (for example, after trying to execute "import nltk" in the terminal, I received "-bash: import: command not found"). The following was outputted to the terminal, which made me think this approach would work:

"[nltk_data] Downloading package stopwords to
[nltk_data] /Users/JohnSmith/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /Users/JohnSmith/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!

New to using the command line here, so sorry for what I'm guessing is a rookie mistake.
screen shot 2018-03-13 at 9 23 13 pm

Recreating in Swift

I am recreating this in Swift for MacOS, and have some questions.

  1. Do you need the headers? Or are they only needed for getting the questions because I tried making some requests without headers and was able to retrieve basic scheduling info and prizes.
  2. When making a request, are the questions located under: https://api-quiz.hype.space/shows/now?type=hq&userId=xxxxx? Using Insomnia and making a request with all the right headers and I only get basic info, is there a separate host to use for getting questions? If you could give me the URL directly to the questions/answers I would appreciate it.

I didn't understand:

# Remove control characters in the WebSocket message
message = re.sub(r"[\x00-\x1f\x7f-\x9f]", "", message)
message_data = json.loads(message)
logging.info(str(message_data))

in your Python version, so if you could clear that up for me (how to get questions/answer) I would appreciate it!

PS: I have noticed that you can still watch the game without being signed into an account so I don't think you would need authentication to do so (and user ID)...

Server timeout?

I keep getting a server timeout error, and all the methods have 0 for each answer. How do i fix this?

2018-04-05

Freezes when PDF is found

This may have just been me, but one of the sites visited was a direct link to a PDF, and it froze the program.

I'm not sure whats happening.

I am getting some short of issue? If you can give me some information on how to fix this.

getting

Show active, connecting to socket at https://ws-quiz.hype.space/ws/44326
Traceback (most recent call last):
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\hq_main.py", line 51, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Dinge\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\networking.py", line 45, in websocket_handler
async with session.ws_connect(uri, headers=headers, heartbeat=5) as ws:
TypeError: ws_connect() got an unexpected keyword argument 'heartbeat'

Errors on emotes

When someone sends a chat with an emote, it says this in the console:
Error

Error with line #37.

Getting this error, any idea where the issue lies? :-)

python3 hq_main.py

getting

Show not on.
Traceback (most recent call last):
File "hq_main.py", line 37, in
next_time = datetime.strptime(response_data["nextShowTime"], "%Y-%m-%dT%H:%M:%S.000Z")
KeyError: 'nextShowTime'

What is a Bearer Token & User ID?

I'm at the step where I need to Enter a Bearer Token and UserID. I don't know how/where to find those, and what purpose they serve. Can anyone assist me?

How do I install

HI,
I opened up the file in python, but I can't get passed the part to import nltk. I don't have the nltk file and don't know where to find it

How to modify this for loco trivia

Hey I have sniffed the traffic for loco trivia. Please tell how to modify this script for loco trivia.
It will be more helpful if you provide the modified script.

Are you able to add other game shows?

The bot is working great but are you able to add other shows such as 'Cash Show', 'The Q' and 'SwagIQ'? I can share the sniffed data if that is needed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.