Automated Club Invites

Sort:
Horial1

I would like to make a process to make every invite count. So far... I am sending the invites manually and I don`t have any control, so maybe I am sending invites for guys that have already been invited.

I want to choose guys that are from my country, Brazil.

The account should be at least one month old.

Have name and surname, have a profile picture, (I choose nice pictures, will not be able to this) OR is a premium subscriber (Its ok for a premium do not have a nice picture or a picture at all, and even name or surname).

I used to be a programmer, I am rusty, so I am spending some time in pythons tutorials.

I would like to prioritize guys that log more often 

So, I will list all the guys using https://api.chess.com/pub/country/BR/players

and for every player, I will call  https://api.chess.com/pub/player/{username} 

And the idea is to do this every day, and I will invite first the guys that logged every day.

And I will keep in a file every invited member.


Is this a good plan  ? Can I do this on an everyday base or will I be surpassing usage limits? Any other suggestions? 

chrka

It sounds workable. Just for fun I hacked something together after your description in case you want to try it out to see what kind of API usage you'll be looking at.

It's the script file "brazil_invites.py" at https://github.com/chrka/chesscom-api-and-graphql-bridge (it requires that you install the "requests" package with "pip install requests"). It stores the usernames of players it has already invited in a file called "invited.txt" and prints out URLs to potential invites.

Now, it uses a higher-level api I wrote in order to do some experiments so the example code does not do straight REST API calls, but maybe it can be useful anyway.

stephen_33

Horial1, if you're using Python, what version is that please?

Horial1

Wonderfull chrka! Thank you very, very much! 

happy.pnghappy.pnghappy.png

 

And it will come in handy for my studies in python, 

 

....

INFO:root:aasoares does not have a full name (None)
INFO:root:aavefenix is a potential invite
INFO:root:aavtal's account is too young
INFO:root:abaddonsrage does not have an avatar or is not premium
INFO:root:abalro does not have an avatar or is not premium
INFO:root:abarcatupa does not have a full name (None)
INFO:root:abarile does not have a full name (None)
....

Horial1
stephen_33 wrote:

Horial1, if you're using Python, what version is that please?

3.7.2

stephen_33

That's the very latest version so you shouldn't have a problem. The reason I asked is that the Requests package is only suitable for Python versions 3.4 & after.

knightburgler

Automated invites is something I have wanted for a long time now. I have a working Python script that could be overhauled to gather the data I need, to produce a list of potential candidates but because it would not be interactive I have not done that. 

I like the parameters Horial listed for who qualifies to be invited but I would like to add to the list:

1. Timeout ratio.  I don't invite members with high timeouts

2. Number of clubs.  I don't invite members who belong to say 100 clubs. 

3. Number of Daily Matches they play.  I only recruit members that like to play daily matches. If all they do is use chess.com as some form of social media (and those people are out there) I have no use for them.

 

Cheers,  

bcurtis

Automatic invites are unlikely to ever be a feature. They would be too easy to abuse. I know such a feature would help you guys a lot, but imagine the 10,000 other club admins deciding that everyone was a great addition to their club and so now all players have an inbox with 10,000 invites to sort through. Even if we prevent the invite from using a custom message (to avoid sending spam advertisements), this would be overwhelming.

For now, your best option is to use the API to find people with a high likelihood of a positive response, and send the invite manually. Be careful. If your offer is not welcome, then they may block you or report you for spam. So target people well.

chrka

Just to be clear, the code I posted above does not actually send out invites — it only prints out the URLs to the profile pages of potential invitees. (It could make sense to set up a periodically running task on, eg., pythonanywhere.com to send them as a list by email to an admin.)

It wouldn't be hard to modify the script to also send invites automatically, but like @bcurtis says, that would be open to abuse.

Horial1

@chrka your code is great, and I am very happy with it. I am tinkering and learning python in the process.

@bcurtis, one feature that I would appreciate, is the information that the club already sent an invite to that person. If you do this, I am quite sure, that you could increase the number of available invites. 

Another great option would be limit the global number of invites for a person, in one week. Maybe 3 is a good magic number. Or even one.

30 invites a day is too little for a Brazil club, because, there are days, that we have much more new chess.com members than that. 

I am considering to do a "help the club grow day", In this day, members would send a msg to other users with the link to the club. I think one msg by the member couldn't be classified as spam. But also I don't want any member, to be blocked. And I am trying to figure out how do not send more than one msg for the same user. Maybe doing an application to choose the recipient.

thank you all. And chess.com is great! 

stephen_33
chrka wrote:

Just to be clear, the code I posted above does not actually send out invites — it only prints out the URLs to the profile pages of potential invitees. (It could make sense to set up a periodically running task on, eg., pythonanywhere.com to send them as a list by email to an admin.)

It wouldn't be hard to modify the script to also send invites automatically, but like @bcurtis says, that would be open to abuse.

This tip may be of use to you in that case. I help to run the TMCL competition on the site & one thing we require is that all admins who are nominated to represent (act for) their teams must join the TMCL club. I have a script that checks which names in the list I keep belong to the club & which don't & the last time I ran it, it produced about 20 names that were absent from our members' list.

Sending 20 invites separately is tedious, so my script creates a string of names as follows:

member_1,member_2,member_3,member_4, ...... etc. (names should be separated by commas!)

That string can then be pasted straight into the member's field in the invite pane. That way you can invite up to 30 people at once. I think our daily limit is 30 member-invites?

That's one possible solution for you.

knightburgler

@chrka Thanks so much for the github link, the code is useful to me for sure! I am not familiar with Docker or Graphql, so there is a learning curve for me but that's not a problem. I just signed up for a Graphql course online so that should help.

Thanks again!

chrka

@knightburgler @chrka Happy to hear it's useful. Good luck with your projects!