[Development] Extracting data of @blocktrades world cup competition

in #blocktradesworldcup7 years ago (edited)

If you guys been active on steem, you will know that recently @worldcup-russia had created a new contest with 2000 sbd prize pool.

Based on what I have search on SteemSQL, they are currently around 574 entries and expected more to come. Therefore checking everyone's results are tedious and time consuming (since there are more than 28 results)

Therefore, @anomadsoul approach me and ask me to write a script yesterday, and I manage to done it this morning.

Based on the code I made, almost half of the entries had issue from wrong format, not written in English, or wrong choices of scores (W for win, L for lose, T for tie). If you want the official format, scroll down to the bottom-most of the post (Appendix section).

Errors

I will be writing an automated script to inform everyone that made a mistake in their post and redirect them here.

If you received a comment from @superoo7-dev regarding about the error, you can refer to the bottom part of this post.

INVALID_LOGIC_OF_COND

This means that some of the scores are invalid. (also could be someone used #blocktradesworldcup and #mypicks but not entering the competition)


unknown.png

I don't think it is possible for a country to win and another to tie at the same time.


unknown (1).png

Check the format below, we just want to know who are the winners, not scores


unknown (2).png

Follow the format?


unknown (3).png

Same as above


COUNTRY_NOT_FOUND

This could be that my script unable to find the country stated.


unknown (4).png

My script does not understand espanyol. yo no hablo español.


image.png

You mean England?


Possible error of my codes

Since the script is written in a day, it might be some errors from my side. I am still working on it right now.

My code cannot understand table well

I am still working on regex to parse this table, I would appreciate if everyone used the markdown version (down in the bottom) (There is a website that will make Table into MarkDown: http://markdowntables.mrvautin.com/ )

<table>
<thead>
<tr><th>Score</th><th>Team</th><th></th><th>Team</th><th>Score</th></tr>
</thead>
<tbody>
<tr><td>W</td><td>Russia</td><td>vs</td><td>Saudi Arabia</td><td>L</td></tr>
<tr><td>L</td><td>Egypt</td><td>vs</td><td>Uruguay</td><td>W</td></tr>
<tr><td>W</td><td>Morocco</td><td>vs</td><td>Iran</td><td>L</td></tr>

My code cannot understand bold

I guess making it bold is easier for human to see, but not a bot. I am still working on features to solve this.

Score | Team | | Team | Score  
-|-|-|-|-  
W | **Russia** | vs | Saudi Arabia | L  
L | Egypt | vs | **Uruguay** | W  
W | **Morocco** | vs | Iran | L  

Conclusion

I guess I am heading towards writing an automated script to comment on everyone's post that made a mistakes. If any doubts you can reach me in the comment here or on Discord (superoo7#2609)

Appendix

Format of the table (in MarkDown)

Replace X with W, L or T

Score | Team | | Team | Score
-|-|-|-|-
X | Russia | vs | Saudi Arabia | X
X | Egypt | vs | Uruguay | X
X | Morocco | vs | Iran | X
X | Portugal | vs | Spain | X
X | France | vs | Australia | L
X | Argentina | vs | Iceland | X
X | Peru | vs | Denmark | X
X | Croatia | vs | Nigeria | X
X | Costa Rica | vs | Serbia | X
X | Germany | vs | Mexico | X
X |Brazil | vs | Switzerland | X
X |Sweden | vs | South Korea | X
X | Belgium | vs | Panama | X
X | Tunisia | vs | England | X
X | Poland | vs | Senegal | X
X | Colombia | vs | Japan | X
X | Russia | vs | Egypt | X
X | Portugal | vs | Morocco | X
X | Uruguay | vs | Saudi Arabia | X
X | Iran | vs | Spain | X
X | France | vs | Peru | X
X | Denmark | vs | Australia | X
X | Argentina | vs | Croatia | X
X | Brazil | vs | Costa Rica | X
X | Nigeria | vs | Iceland | X
X | Serbia | vs | Switzerland | X
X | Belgium | vs | Tunisia | X
X | Germany | vs | Sweden | X
X | South Korea | vs | Mexico | X
X | England | vs | Panama | X
X | Japan | vs | Senegal | X
X | Poland | vs | Colombia | X
X | Uruguay | vs | Russia | X
X | Saudi Arabia | vs | Egypt | X
X | Spain | vs | Morocco | X
X | Iran | vs | Portugal | X
X | Denmark | vs | France | X
X | Australia | vs | Peru | X
X | Nigeria | vs | Argentina | X
X | Iceland | vs | Croatia | X
X | South Korea | vs | Germany | X
X | Mexico | vs | Sweden | X
X | Serbia | vs | Brazil | X
X | Switzerland | vs | Costa Rica | X
X | Japan | vs | Poland | X
X | Senegal | vs | Colombia | X
X | England | vs | Belgium | X
X | Panama | vs | Tunisia | X
Sort:  

To allow the bold format is easy, if your script uses javascript, just do for each line this: line.replace("*", ""); and process the rest as normal.

Thanks for the suggestion, i was trying to solve it the regex way hahaha.

when you try to solve a problem with regex, you got another problem

I also parsed all the data and created analysis of Steemit's collective guess with likelihood of all results.
https://steemit.com/blocktradesworldcup/@worldcup-russia/you-still-have-time-join-the-blocktrades-world-cup-and-win-2-000-sbd-in-prizes
world_cup_analysis3.png

impressive work! too bad I am busy preparing my exam, or else I am going to post a post on rejected and accepted post and all the data

I already corrected the publication, although I did not see where the country's error was. If you can review and subsequently inform me. Take the format placed at the end of your post. Grateful.

https://steemit.com/blocktradesworldcup/@sirtorito/la-copa-mundial-blocktrades-or-mis-predicciones-div

Thanks for the capture but one of the rules of teh contest is once submitted we cannot edit anymore.

Also I copied it from the mexican trail markdown.

Never mind haha. I saw where the reply was and it was to a translation post I made.

haha, the bot can't recognize the difference

Hahahha yeah and I was worried that my entry had issues but good thing it was the translation.

But thank you for doing this!

there are more than 500 entries (expected more to come), so human checking the post are just impossible, so need to let everyone knows about it. I guess everyone need to read the instructions clearly haha

There is some issues with your entry for blocktrades World Cup contest, where I am not able to extract out your contest entry data.

The error name is: COUNTRY_NOT_FOUND_1


This is an automated message script written by superoo7.
For more details about your error, please refer to the development post

Hello @superoo7, I get that error: COUNTRY_NOT_FOUND_1
but as I can say that I can not modify the table, I also do not see what my error is, you can advise me with that, thank you very much

noted bro!!! i entered Draw for D not Tie "T "

i should edit the D to T

I fix that already tho, the code can understand both T and D

noted @superoo7, cheers for that !!

So, can we edit the errors, or what we must do?

definitely, make sure do it before 14/06

The error name is: COUNTRY_NOT_FOUND_2

I just got a messge saying I had an error (above)

I just had quick look at my entry, I see no incorrect countries or spellings...

you missed out a row of Iran and Spain

can i just forget about it, or do I have to send a result?

Just edit it, its fine

ok, done
thanks.

Hi @superoo7,
Thanks for the automated message.
I knew I did an error, but reading the Rules, no editing is allowed.
My error is X instead of T... can I change that?
Thanks again

sure, you can just change that. as long as it is before 14/06

Oky doky... I just fixed the error.
Hope is fine now.
Have a nice day!

You've been upvoted by TeamMalaysia Community :-

To support the growth of TeamMalaysia Follow our upvotes by using steemauto.com and follow trail of @myach

Vote TeamMalaysia witness bitrocker2020 using this link vote for witness

@superoo7 thanks for the alert. I saw where the mistake was. It was for England and Belgium. I choose to tie for both but put T for one and put D for another. The D means to draw. I have rectified it.

I hope my entry is still valid.

as long as it is before 14/06, all entries are valid.

Coin Marketplace

STEEM 0.21
TRX 0.24
JST 0.038
BTC 94636.84
ETH 3278.73
USDT 1.00
SBD 3.16