Go to the top conference is a very popular live answer game recently, open at designated time every day, 12 questions, 3 options for each question, 10 seconds to answer, all clearance share the prize (each bonus of 50,000 yuan or 100,000 yuan). Many other similar games, such as Toutiao, Inke and Huajiao Live, have launched their own quiz games. The ancestor of this model is HQ Trivia, which was launched in the United States in August last year.
There’s no time to search for a topic (unless you’ve been single for 40 years), and there’s no shortage of cheating strategies. The easiest way is to play with a group of people, which can take advantage of the network delay to have a few more seconds of reading time. If you meet someone who can’t read the question, you can choose separately, so that you only need 3^12= 531,441 phones to complete the game. You can also use two devices, one mobile phone to wait for the host to read the question, the other baidu voice search can also find out the answer, but feel that the speed is relatively slow.
So how should programmers play?
First use WDA to get a screen shot. WDA is a set of iOS testing framework developed by Facebook. A few days ago, I saw that everyone was using wechat “Tiaotiaotiao” plug-in, so I deliberately went to understand it, and found that it can also be used in the summit conference.
After that, crop out the location of the topic (it may need to be adapted to the mobile phone screen), then call the open OCR interface to read and fetch the text, and finally call the search engine, and the effect of the GIF image can be achieved. This environment is iOS + Mac, if it is Android there should be a more convenient way.
Actually the original idea is to want to search + select answers all complete automation, train of thought is the OCR questions and candidate answers, composed of three combinations to search in baidu or Google, which is the result of the combination appear most times then choose which, after tried several problems found and is not the case, such as the above picture of “what is the camel’s hump store?” “Probably most people think it’s water, so it comes up the most often, which is actually the wrong answer.
Finally, there are two pain points:
- The free OCR interface is called a limited number of times, so you can’t always go to the screen to identify, just wait for the problem to run the program.
- The e official is also very routine, some problems can not search. Like this:
Attached code, I wonder if you have a better idea:
# python3 import wda import io import urllib.parse import webbrowser import requests import time import base64 from PIL Import Image c = wda.client () # API api_key = "" api_secret =" "token =" "while True: PNG) im = image.open ("./1.png") region = im.crop((75, 315, 1167, 789)) # iPhone 7P imgByteArr = io.BytesIO() region.save(imgByteArr, format='PNG') image_data = imgByteArr.getvalue() base64_data = base64.b64encode(image_data) r = Requests. Post (' https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic ', params = {' access_token: token}, data = {' image ': base64_data}) result = '' for i in r.json()['words_result']: result += i['words'] result = urllib.parse.quote(result) webbrowser.open('https://baidu.com/s?wd='+result) breakCopy the code