[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

hey there I had entered my post almost 2 weeks ago and the bot marked an error in it now I cant seem to edit it with the new format that you have provided can I post the same results again in a new post according to your format thanks.

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 !!

testing

Don't tell me you use same bot for coding this? Please don't mess up it. 😆

Its just a test 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: INVALID_LOGIC_OF_COND


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

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.

Hey, I got an error, I guess because I was writing the table instead of markdown...

Yea, I am still working on the script to extract it, just in case I cant make it haha (cuz you cant edit post after 7 days) 😅

I see, I'll put a reminder coz it takes too long to transfer all the results, no worries, if you can't extract in like 4 days, I'll edit it :D

Loading...

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.

Hi there , i received a "country not found" in my entry soo i used the format in the example you have in the first post about the contest. Hope it's ok now . let me know.
Thanks.

https://busy.org/@giosou/the-blocktrades-world-cup-or-my-selections

Very good your post my friend

Okay, i found the error in Tunisia vs England. so can i just edited it ?

I have read the answer of my question, Thanks @superoo7. You did a great work here.

Please spare my content what's right.

Just brilliant to see what you can do with a little piece of code.
I would have hoped at less competition.

Do you also have some code to get the data into Excel? Or how will you keep track of the results?

I extracted the data from SteemSQL, then processed it with some codes and store it in a file. I plan to use that file on Tableau to visualize the data.

@superoo7
Great thing you are doing. It will save them a lot of time! I know becaus I am hosting also a world cup contest and had to approve all entries manually!
#steemitbloggers

Thanks for stopping by 🙂

Stopping by and thanking someone for their hard work is a lot easier than doing the hard work 😁
So no biggy!
Feel free to participate in my world cup contest!

Thanks for this @superoo7, it makes entering the contest super easy. I have zero clue about soccer but gotta be in it to win it.

2000sbd pools to win!

😆😆😆

Hello! I received message INVALID_LOGIC_OF_COND
It seems I made a mistake:
W France vs Australia W
So, both teams win.
Now it is rectified.
Am I still eligible for the contest?

Esto significa que no estamos participando?

yo no hablo español.

I don't speak spanish. so, I cant understand what you mean.

Does that mean we are not participating?

Everything should be written in English, use the template I had given for ur entry and you will be fine. Don't translate it.

Hey :D Thanks for helping me ! I just found my error , Do I have to edit the Post or should I create a new one ?

just edit will be fine

thanks should be valid now :)

I have updated my post with the correct format, sorry for the trouble...
https://steemit.com/blocktradesworldcup/@pele23/the-blocktrades-world-cup-or-my-selections

Whoa seeing how this code works is really interesting! What a cool contest too! Good luck to all that enter! Upvoted :)

Got an error again. 😭 Msg is INVALID_LOGIC_OF_COND

check argentina and iceland: l l

Thanks a lot. Sorry for keep you working...

let me check, one sec

Hey @superoo7 have created the lost by copying the format from the link mentioned on the post...still i got the automated reply...let me know what need to be done as in case editting is not allowed on the post

Thanks for the correction.
So should we edit the posts or we correct our errors in a different post?

can perticipate edit their error on his post?

Hello thank you for explaining the error, please make the adjustments please inform me if everything is perfect and if you already give me entry to the contest
https://steemit.com/blocktradesworldcup/@chanchuy/the-blocktrades-world-cup-or-my-selections#comments

ready already make the corrections with the countries thanks for the warning

https://steemit.com/blocktradesworldcup/@erick777/the-blocktrades-world-cup-or-my-selections

Thanks for this, found the line that was off and edited it. Much obliged!

Hello @ superoo7, I received the automatic message notifying that the name of the error is: COUNTRY_NOT_FOUND_1
Ready I made the correction, change my entry to the correct format, I hope you can review, here I leave my participation.

can i resubmit or make the necessary corrections again @superoo7?

English

Good evening friend @superoo7 this is my publication repaired error tell me if the other deletes or what do with the other?

I'm still participating?


Spanish

Buenas noches amigo @superoo7 esta es mi publicación Error reparado diganme si el otro lo elimino o que hago con el otro?

Todavía estoy participando?

You can only send in 1 entry, just edit the old one would be fine

P.s. I dun speak spanish

hi friend @ superoo7 already make the adjustments, with that is enough to enter the contest?

I didn't check my message since I made this prediction 11 days ago. Is it still possible to continue the contest by correcting my error: INVALID_LOGIC_OF_COND by not making any alternation on my prediction? Thanks. I didn't know I have an error. My blog: https://steemit.com/blocktradesworldcup/@life69/the-blocktrades-world-cup-or-my-selections