Why should we join wechall
Mainly we want to connect challenge/riddle sites, beside that we want to create a global ranking for these sites.
Writing 2 small scripts is not too hard and we do not cause a lot of traffic. If your site has riddles or challenges and keeps track of a users solving progress you are very welcome here.
Also we do not expose user credentials, steal email or whatever. We are a free site, only with the fun of solving problems and learning new stuff in mind.
How to make other sites work with WeChall
To make a site work we need to interact with it.
In particular we need a script to validate accounts on your site,
as well as a scoring script.
The scripts are using GET requests, and the values are urlencoded.
The script and variable names can all be chosen freely.
1: A script to validate that a user owns an account at your site.
validatemail.php?username=%USERNAME%&email=%EMAIL%[&authkey=%AUTHKEY%]this script must return simply "1" OR "0",
1:email/username combination exists.
0:combination does not exist or authkey wrong.
Please make sure that your users have the possibilty to change their emails or at least have some "used"/existing email address.
To link accounts to wechall you have to confirm linking via this email address. (if they registered here with the same email there is no need to send mails).
hackthissite.org pointed out that the old API was prone to private information disclosure. You can simply use the script to test users against emails or vica versa.
We introduced the optional AUTHKEY variable to make it not publicy exploitable.
You can choose your authkey freely, but it has to be exact 16 ascii chars long.
2: A script that returns the users score on your site.
userscore.php?username=%USERNAME%[&authkey=%AUTHKEY%]
making use of authkey is optional here. If you have public accessible profiles you can just ignore it.
The format of the output does not matter, since we write seperate code for each site.
Your output must contain at least userscore and maxscore.
So the output of this script could be like "userscore:maxscore".
You can also output something like "username has solved solved
of total and is rank rank of usercount"
(see point 5)
WeChall is also capable of updating user and challenge count via this script.
Good output for this script is: rank:score:maxscore:usercount:challcount
3a: An icon, 32*32, transparent gif preferred.
3b: A description of your site, can be in the sites language.
3c: The wanted displayed sitename. You also use this name for remoteupdate.php
4: [OPTIONAL] A page that shows your users profile.
profile.php?username=%USERNAME%This is more part of your site, optional, and will show a (complete) profile of the user.
If you like to support us with this script, make sure you dont need to login for that.
5: [OPTIONAL] Updating WeChall automatically
There are two ways to automatically update your users scores on WeChall:
- The first is to have your application make a request to
http://www.wechall.net/remoteupdate.php?sitename=%SITENAME%&username=%USERNAME%
whenever a user completes a challenge.
This will return a text string with the result of the operation.
Example:
echo '<a href="http://www.wechall.net">WeChall</a> reports: ';
echo file_get_contents("http://wechall.net/remoteupdate.php?sitename=%SITENAME%&username=%USERNAME%");
or
echo '<a href="http://www.wechall.net">WeChall</a> reports: '; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.wechall.net/remoteupdate.php?sitename=%SITENAME%&username=%USERNAME%"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch);- The second is to put an image in the page a user gets when he/she solves a challenge.
http://www.wechall.net/remoteupdate.php?sitename=%SITENAME%&username=%USERNAME%&img=1
This will return an image with the result of the operation.
Example:
<a href="http://www.wechall.net"><img src="http://www.wechall.net/remoteupdate.php?sitename=%SITENAME%&username=%USERNAME%&img=1" alt="http://www.wechall.net" border=0/></a>
If you opt to do this, we won't have to make periodical requests to your site to see if any of our users have a change in their score.
6: [OPTIONAL] Pipsqueek-IRC-Bot Interaction
A script that returns userstatus in form of a single text line. We use this bot on irc.idlemonkeys.net
The content type has to be text/plain and the output has to be a single line, not exceeding 192 characters.
The script has to be like yourscript.foo?username=%USERNAME%. Note that the GET parameter username can not be chosen freely.
It is also a nice feature to display the stats for rank #N with this script when an integer is given as username
Please contact us if you need more information or help with writing your scripts.
